in reply to Help me not use for($i=0;$i=$#array;$i++)...Please!
Update: Got called away for dinner and didn't get a chance to finish(but it looks like others beat me anyway).for $i(0..$#array) { splice @array, $i, 1 if $array[$i] == 5; }
Also, it all you care about is the value of the array, i.e., not its index, you could use this:
for (@array) { ... if $_ == 5. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Help me not use codefor($i=0;$i=$#array;$i++)/code...Please!
by chromatic (Archbishop) on Jun 21, 2001 at 05:07 UTC | |
by Abigail (Deacon) on Jun 21, 2001 at 05:12 UTC | |
by iakobski (Pilgrim) on Jun 21, 2001 at 15:38 UTC |