Hi, im trying to run a perl script at a company website. The script gets an url, converts some stuff we need into xml code and then generates the file, which should go in a different directory of the server. It's supposed to be called from another perl script we have on the server, and it works perfectly fine in my localhost web server, producing output and so, but when uploaded the xml file is not created. Any idea of where should i be pointing at?
So here is the code, notice im not very into perl...
#!/usr/bin/perl -w
use LWP::Simple;
use HTML::TokeParser;
my $page= get('$url') or die("$!");#thats the webpage
my $stream= new HTML::TokeParser(\$page);
$file = "bestsellers.xml"; #the file,if exists I delete it
unlink($file);
open(f1, ">>bestsellers.xml") or die("Can't open .rss file: $!");
print f1 "<?xml version='1.0' encoding='ISO-8859-1'?>\n";
print f1 "<rss version='0.91'>\n";
print f1 "<best>";
print f1 "<title>The title</title>\n";
print f1 "<link>$url</link>\n";
while(my $tag = $stream->get_tag("table"))
{
if ($tag->[1]{name} and $tag->[1]{name} eq "product")
{
#do the stuff for scrapping what i need and
#writing it into f1
}
}
print f1 "</best>\n";
print f1 "</rss>\n";
close f1;
20041123 Janitored by Corion: Fixed formatting