Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Removing a string-element from an array of strings

by AnomalousMonk (Bishop)
on Jul 26, 2020 at 21:30 UTC ( #11119842=note: print w/replies, xml ) Need Help??


in reply to Re^2: Removing a string-element from an array of strings
in thread Removing a string-element from an array of strings

Here's another approach if you're looking for an exact string match for one of multiple choices:

c:\@Work\Perl\monks>perl -wMstrict -le "use List::MoreUtils qw(part); ;; my @history = qw(Foo::End(3) dhcp-options(5) Back_word(3) audit-packa +ges(8)); print qq{before: (@history)}; ;; my %choices = map { $_ => 1 } qw(Back_word(3) Foo::End(3)); ;; @history = map @$_, part { exists $choices{$_} } @history; print qq{after: (@history)}; " before: (Foo::End(3) dhcp-options(5) Back_word(3) audit-packages(8)) after: (dhcp-options(5) audit-packages(8) Foo::End(3) Back_word(3))


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119842]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2020-09-30 22:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (170 votes). Check out past polls.

    Notices?