in reply to Re: Help me not use codefor($i=0;$i=$#array;$i++)/code...Please!
in thread Help me not use for($i=0;$i=$#array;$i++)...Please!
Bang, uninitialized value and @array is 9 elements long at the end. Yikes.my @array = (0 .. 9); $" = " "; for my $i (0 .. $#array) { splice @array, $i, 1 if $array[$i] == 5; print "$i: @array\n"; } print "Array is ", scalar @array, " elements long.\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help me not use codefor($i=0;$i=$#array;$i++)/code...Please!
by Abigail (Deacon) on Jun 21, 2001 at 05:12 UTC | |
by iakobski (Pilgrim) on Jun 21, 2001 at 15:38 UTC |