alkis has asked for the wisdom of the Perl Monks concerning the following question:
the code above delete the values of the repeated terms but it leaves the position blank ($TERMS[$i]), i want to delete the position too...how can i do that?foreach $term (@TERMS){ push(@INDEX,$term); for($i=0; $i<scalar(@TERMS); $i++){ if ($term eq $TERMS[$i]){ delete $TERMS[$i]; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: delete an element from an array
by FunkyMonk (Bishop) on Apr 07, 2008 at 18:52 UTC | |
|
Re: delete an element from an array
by kyle (Abbot) on Apr 07, 2008 at 18:57 UTC | |
|
Re: delete an element from an array
by runrig (Abbot) on Apr 07, 2008 at 19:00 UTC | |
|
Re: delete an element from an array
by dwm042 (Priest) on Apr 07, 2008 at 20:52 UTC |