Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Effecicncy of key-only hash

by leonidlm (Pilgrim)
on Aug 24, 2008 at 08:06 UTC ( [id://706510]=note: print w/replies, xml ) Need Help??


in reply to Re: Effecicncy of key-only hash
in thread Effecicncy of key-only hash

I know it isn't my thread but I had to ask: Can you please explain what you are doing here:
undef(@hash{qw(shave the modern way)});
Why you accessing a hash as an array ? ('@' char)? I am missing something I think ...

Replies are listed 'Best First'.
Re^3: Effecicncy of key-only hash
by moritz (Cardinal) on Aug 24, 2008 at 08:48 UTC
    The @ tells you that what you expect to return is an array, and the curly braces {...} tell you that what you access is a hash.

    qw(shave the modern way) is a list, so @hash{qw(shave the modern way)} is a list ("slice") of items in %hash with the listed keys.

Re^3: Effecicncy of key-only hash
by FunkyMonk (Chancellor) on Aug 24, 2008 at 08:55 UTC
    It's a hash slice. See perldata for more information on hash and array slices

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found