in reply to Deleting Elements from an Array without their Index Number?
Do you want to remove coin from the array?
my @not_coin = grep { $_ ne 'coin' } @array;
Or do you want to replace coin by undef?
my @not_coin = map { $_ eq 'coin' ? undef : $_ } @array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Deleting Elements from an Array without their Index Number?
by Fletch (Bishop) on Jul 23, 2006 at 23:58 UTC | |
|
Re^2: Deleting Elements from an Array without their Index Number?
by diotalevi (Canon) on Jul 24, 2006 at 00:32 UTC | |
by Anonymous Monk on Jul 24, 2006 at 15:18 UTC | |
by diotalevi (Canon) on Jul 24, 2006 at 15:45 UTC |