in reply to Re^5: Help needed with regard to arrays
in thread Help needed with regard to arrays

Yes...only 1 is connecting/running. I am using ssh through a system() call
  • Comment on Re^6: Help needed with regard to arrays

Replies are listed 'Best First'.
Re^7: Help needed with regard to arrays
by Corion (Patriarch) on Nov 20, 2008 at 20:39 UTC

    Maybe you can show us your code? I have a hard time imagining your code.

      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;
      The code reads a file which has something like ssh storeplaceholder -l xyz "/usr/bin/ls"

        I don't see you using strict and I don't see you initializing $max_thread_count. Also, \processWF is not valid Perl syntax. Please post the code you use, not something you type in from another window.