Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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

by kcott (Bishop)
on Jul 26, 2020 at 00:25 UTC ( #11119810=note: print w/replies, xml ) Need Help??


in reply to Removing a string-element from an array of strings

Here's one way:

$ perl -E 'my @x = qw{A B C D}; @x = grep $_ ne "B", @x; say "@x"' A C D

— Ken

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2020-11-24 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?