multithreading - perl threading problem -
I am writing a multithreaded website uptime checker in Perl, and even the basic code is still up to now (Threading only In section): #! Use / Usr / bin / perl LWP :: UserAgent; Getopt :: Use Std; Use threads; Use thread: share; My $ Max: Share = 50; My $ Thread: Share = 0; Print "Website Uptime Checker \ n"; My $ infilename = $ ARGV [0]; Chomp ($ infilename); Open (INFILE, $ infilename); My $ outfill = $ ARGV [1]; Chomp ($ outfilename); Open (OUTFILE, "& gt;" $. $ Outfilename); OUTFILE- & gt; Autoflush (1); While ($ site = & lt; INFILE & gt;) {chomp ($ site); While (1) {if ($ Threads <$ maxthreads) {$ Threads ++; My $ thr = thread- & gt; Create (& amp; check_site, $ site); $ Thr- & gt; Apart (); last; } And {SO (1); }}} While ($ threads gt; 0) {sleep (1); } Sub-check_site {$ server = $ _ [0]; Print "$ server \ n"; $ Threads--; } This returns an error after a while: Do not call the "different" method on