The code reads a file which has something like ssh storeplaceholder -l xyz "/usr/bin/ls"my $jobs = Thread::Queue->new(@stores); # read work file sub processWF { my $val = shift; open(WORKFILE, "<$workFile"); my @lines = <WORKFILE>; #@lines = sort @lines; #chop @lines; while (defined (my $item = $jobs->dequeue)) { foreach my $line (@lines) { $line =~ s/storeplaceholder/$item/; print "running: $line"; system($line); } } close(WORKFILE); } $jobs->enqueue(undef) for 1..$max_thread_count; my @workers = map { threads->create( \processWF ) } 1..$max_thread_cou +nt;
In reply to Re^8: Help needed with regard to arrays
by theknightsofni
in thread Help needed with regard to arrays
by theknightsofni
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |