derby is right, in that you normally wouldn't want to hard-code the termination value of a loop that iterates over an array (i.e., use $#ips rather than 15).
Also, be aware that the C idiom:
for ($x = 0; $x < @ips; $x++) {or:
for ($x = 0; $x <= $#ips; $x++) {is frequently coded in Perl as this:
for my $x (0..$#ips) {in cases where the loop index, $x is needed within the loop. Otherwise, when it isn't really necessary (as in your case), you'll frequently see derby's suggestion used or perhaps this variation which avoids use of the implicit $_:
for my $ip (@ips) { push @newips, $ip->[0]; push @attempts, $ip->[1]; }
dmm
You can give a man a fish and feed him for a day ...In reply to Re: Help with a n Use of uninitialized value in join error message
by dmmiller2k
in thread Help with a n Use of uninitialized value in join error message
by dru145
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |