Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Dereferencing a Hash of Arrays

by philipbailey (Chaplain)
on Jun 14, 2011 at 07:19 UTC ( #909538=note: print w/ replies, xml ) Need Help??


in reply to Dereferencing a Hash of Arrays

Your problem is that the values in hashes can only be scalars in Perl. However references are scalars, so you can use references to arrays:

my %alphabet = ( a => \@atags, b => \@btags, ); say for values %alphabet;


Comment on Re: Dereferencing a Hash of Arrays
Download Code
Re^2: Dereferencing a Hash of Arrays
by toro (Beadle) on Jun 14, 2011 at 07:27 UTC

    Hi Philipbailey, I tried that earlier but man perlref told me I could abbreviate that as my alphabet = \(.... Are they not the same?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2014-12-21 12:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls