juan25 has asked for the wisdom of the Perl Monks concerning the following question:
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Running script at server
by zejames (Hermit) on Nov 23, 2004 at 15:19 UTC | |
Re: Running script at server
by Anonymous Monk on Nov 23, 2004 at 15:15 UTC | |
Re: Running script at server
by ikegami (Patriarch) on Nov 23, 2004 at 16:37 UTC | |
by juan25 (Initiate) on Nov 23, 2004 at 17:42 UTC | |
Re: Running script at server
by rdfield (Priest) on Nov 23, 2004 at 16:04 UTC | |
Re: Running script at server
by Mutant (Priest) on Nov 23, 2004 at 15:34 UTC |