Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Dereference a hash constant

by bichonfrise74 (Vicar)
on Oct 22, 2009 at 00:24 UTC ( [id://802568]=note: print w/replies, xml ) Need Help??


in reply to Dereference a hash constant

Hmm... Can you try this?
#!/usr/bin/perl use strict; use constant foo =>{ key1 => 'val1', key2 => 'val2' }; for my $i ( foo ) { for my $j (keys %{$i} ) { print "$j - $i->{$j}\n"; } }

Replies are listed 'Best First'.
Re^2: Dereference a hash constant
by Anonymous Monk on Oct 22, 2009 at 00:38 UTC
    That works. Thanks much!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found