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


In reply to Running script at server by juan25

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.