waxmop has asked for the wisdom of the Perl Monks concerning the following question:
Here's what I want to accomplish:
my @arr = qw(aa bb cc); my $var = "aa"; yoink(@arr, $var); print "@arr\n"; # now, @arr is qw(bb cc);
The yoink() function would remove from the array any elements that match the $var variable.
Is there a function to accomplish this already? I'm about to write "yoink()", but before I do, I thought I'd check with the resident geniuses around here.
Thanks as always.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to rm an element from an array?
by I0 (Priest) on Oct 28, 2002 at 01:25 UTC | |
Re: how to rm an element from an array?
by graff (Chancellor) on Oct 28, 2002 at 01:41 UTC | |
by atcroft (Abbot) on Oct 28, 2002 at 03:12 UTC | |
by blokhead (Monsignor) on Oct 28, 2002 at 03:52 UTC | |
by tobyink (Canon) on Feb 27, 2020 at 23:30 UTC | |
Re: how to rm an element from an array?
by Revelation (Deacon) on Oct 28, 2002 at 03:30 UTC | |
Re: how to rm an element from an array?
by jdporter (Paladin) on Oct 28, 2002 at 17:53 UTC |
Back to
Seekers of Perl Wisdom