Hey guys, this is pissing me off. I've written a perl script wich is a crawler (something that searches for information on web sites). After some time executing, the script just freezes, stops, and does nothing else. I don't even get any error messages.

I think it's a memory issue, cause the crawler stops just after a line like this:

$fileContent = ` cat $DIR_INPUT/$FILE `;

I'd really, really apreciate if anyone could help.

thanx in advance.

UPDATE:

MidLifeXis, it stops right after that line. if I try to print the var $fileContent after the cat command, I get an incomplete html page source.

here's some more code:

$DIR_INPUT="./CAPTURE"; while($i <= $npages){ $FILE = $i . $IN_FILE; &wget($URL . $PAG . $i, $FILE, '', ''); #sub that call the wg +et &capture($FILE); } ... sub capture{ my $FILE = $_[0]; $fileContent = ` cat $DIR_INPUT/$FILE `; print $fileContent; # Here's where it stops ... }

As I said before, after some iterations of the while loop, the program suddenly stops, and the print I get on screen is an incomplete page source.


In reply to Perl Script stops in middle of execution, no error messages by MatheusAA

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.