Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^7: Perl Idioms Explained - keys %{{map{$_=>1}@list}}

by Roy Johnson (Monsignor)
on Mar 02, 2005 at 16:11 UTC ( #435898=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Perl Idioms Explained - keys %{{map{$_=>1}@list}}
in thread Perl Idioms Explained - keys %{{map{$_=>1}@list}}

I would not have expected #3's behavior. Would you? I think it merits an "undef is not a listop" warning. The correct way to undef the values is: @h{qw|a b c|} = ();
The correct way to autovivify them but leave them unmodified if they already exist is () = \@h{qw(a b c)};


Caution: Contents may have been coded under pressure.


Comment on Re^7: Perl Idioms Explained - keys %{{map{$_=>1}@list}}
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2015-07-30 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls