use strict; use threads; use threads::shared; my $cnt:shared = 0; my $t = threads->new(\&get_input); while(1){ #simulate some task ++$cnt; sleep 2; } $t->join(); sub get_input{ while(1){ my $key = <>; chomp $key; if($key eq " "){ print "$cnt\n"; } } }
In reply to Re: Report current results during batch process?
by johnnywang
in thread Report current results during batch process?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |