|
Hi Ovid:
I was reading through your module and its looks like it may help me with my problem. Unfortunately, I'm not very good at writing perl...here's my problem:
I need to write translated values that are sent to browser to a text file.
I have this test page:
http://www.dog-crates.com/cgi-bin/write_test_softcart2.pl
here's the pl code:
#!/usr/bin/perl5
use strict;
use CGI qw(:standard);
my $upname10="selector10.txt";
print "Content-type: text/html\n\n";
print"<header>";
print<<DDPENWE1;
<title> crates test</title>
<SCRIPT LANGUAGE="JavaScript">
SCPath = "/cgi-bin/SoftCart.exe";
config = "scstore";
if (location.pathname.substring(0,SCPath.length)!= SCPath) {
window.location.replace(SCPath + location.pathname + "?E+" + config);
}
</Script>
</head>
<body>
DDPENWE1
my $description = "%%product(99901BB).micro_description%%";
open (File10, ">$upname10" || die "Error opening file $upname10");
print File10 "Below is the description of SKU 99901BB that has been properly interpreted by SoftCar
+t:";
print "Below is the description of SKU 99901BB that has been properly interpreted by SoftCart:<br><
+br>";
print File10 "<b>%%product(99901BB).micro_description%%</b>";
print File10 $description;
print $description;
print "<b>%%product(99901BB).micro_description%%</b>";
close (File10);
print"</body>";
print"</html>";
If you click on the link, you'll see that the page gets reparsed so softcart can interpret the tag - the page displays the following:
Below is the description of SKU 99901BB that has been properly interpreted by SoftCart:
The smallest of the lifestyle series, this 2 liter twin turbo really packs a wallop. Able to leap tall buildings with a single bound. Use this crate for small dogs, such as pekinese, Yorkies, and fendermen benz.The smallest of the lifestyle series, this 2 liter twin turbo really packs a wallop. Able to leap tall buildings with a single bound. Use this crate for small dogs, such as pekinese, Yorkies, and fendermen benz.
The text file that I write to however, selector2.txt, displays the following:
Below is the description of SKU 99901BB that has been properly interpreted by SoftCart:%%product(99901BB).micro_description%%%%product(99901BB).micro_description%%
How can I write the "interpreted" version to the selector2.txt file.
Will the HTML::TokParser module help me achieve this??
your help would be greatly appreciated.
thanks,
rich |