in reply to remove element from array
If there's a good chance that the element will be early on in the array, then something like this might be a bit faster.
my $i; foreach $i (0 .. $#mit2) { last if $mit2[$i] eq $rname; } splice @mit2, $i;
Oh, it also assumes that the element you want to lose only appears once in the array.
--Perl Training in the UK <http://www.iterative-software.com>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: remove element from array
by Monky Python (Scribe) on Sep 11, 2001 at 17:44 UTC |