Let me also note that you're cluttering your @smokearr doing the cycles the way you do. When you use the cycle the first time, it terminates after $index becomes equal to 8, adding an element undef to the array, which evaluates to false. Whether this is what you really wanted is up to you, of course, but I'd feel safer using something like:1 while (wait > 0);
This takes advantage from the fact that an array evaluated in scalar context gives you the number of elements in the array itself.for (my $index = 0; $index < @smokearr; ++$index) { #...
Moreover, you don't seem to use $index other than for indexing the array, in which case I'd better use the more Perlish:
which, in my opinion, improves readability (and it's less typing, too :).foreach my $item (@smokearr) { # ... use $item instead of $smokearr[$index] ... }
Flavio (perl -e "print(scalar(reverse('ti.xittelop@oivalf')))")
Don't fool yourself.In reply to Re: Fork Wait and probably grandchildren
by polettix
in thread Fork Wait and probably grandchildren
by Discordanian
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |