in reply to Deleting an array entry

Congratulations, you've just reinvented a limited version of grep().
@filtered = grep { $_ ne $current_log } @original;

If instead, you have an array index instead of a condition, use splice(). The next will delete the third item:

splice @array, 2, 1;
This modifies the original array, instead of making a filtered copy. Well, you can always use an array slice:
@filtered = @original[grep { $_ != 2 } 0 .. $#original];
The grep makes a complete list of all array items, from 0 to $#original, but without the 2.

Replies are listed 'Best First'.
Re: Deleting an array entry
by Jaspersan (Beadle) on Nov 28, 2002 at 17:56 UTC
    Here is the code i use:
    for (my $i = 0; $i < @array};$i++) { if ($array($i) eq $nick) { splice(@array},$i,$i+1); last; } }

    But I really havent done much array element removing (just read about splice yesterday ;)).

    ^jasper