in reply to Re: Re^2: how to rm an element from an array?
in thread how to rm an element from an array?
Slightly different, but I quite like this:
sub yoink (&\@) { @{$_[1]} = grep !$_[0]->($_), @{$_[1]} } my @arr = qw( aa bb cc ); yoink { $_ eq 'bb' } @arr; print "@arr\n";
In Section
Seekers of Perl Wisdom