Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Consise way to filter out keys with undef values from a hash slice?

by davido (Cardinal)
on Jun 02, 2020 at 14:59 UTC ( [id://11117601]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %args = (profile => 'foo');
    my %ta = map {defined($args{$_} ? ($_ => $args{$_}) : ()} qw(profile u
    +ser password);
    
  2. or download this
    my @array = grep {COND} LIST;
    my @array = map {COND ? $_ : ()} LIST
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-18 22:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found