in reply to search array for item, move to next item
But in this case, using a C-style loop makes sense:
Note that if "-iL" is the last word, undef is assigned to $target_word, which effectively is a no-op.my $target_word; for (my $i = 0; $i < @arglist; ++$i) { $target_word = $arglist[$i+1], last if $arglist[$i] eq "-iL"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: search array for item, move to next item
by Fletch (Bishop) on Oct 17, 2008 at 14:33 UTC |