ok i did that. Can't see why value shouldn't be defined though :/
Can't call method "start" on an undefined value at line 18. Can't call method "finish" on an undefined value at .\multithreadsTe\3 +.pl line 25. </code which basically are following lines in my code: <code> line 18: $pm->start and next LINKS; line 25: $pm->finish;
my modified code again:
#!d:\perl\bin\perl.exe use Parallel::ForkManager; use LWP::Simple; use Try::Tiny; try{ my $pm = Parallel::ForkManager->new(6);} catch {print "error 1 \n"; exit;}; LINKS: for my $link ('http://us.a1.yimg.com/us.yimg.com/i/ww/m5v9.gif', 'http://hooboy.no-such-host.int/', 'http://www.yahoo.com', 'http://www.ora.com/ask_tim/graphics/asktim_header_main.gif', 'http://www.guardian.co.uk/', 'http://www.pixunlimited.co.uk/siteheaders/Guardian.gif') { try { $pm->start and next LINKS; } catch { warn $_; print "### ", $link, " \n error 2 \n"; next;}; try{ my ($content_type, $document_length, $modified_time, $expires, $ +server) = head($link); print "$link fetched: declared lenght $document_length, \n"; } catch{print "error 3 \n";}; try{$pm->finish; } catch{ warn $_; print "error 4 \n";}; };

In reply to Re^2: Crash with ForkManager on Windows by amitsq
in thread Crash with ForkManager on Windows by amitsq

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.