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 ( #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
Node Status?
node history
Node Type: note [id://802568]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2018-06-21 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (118 votes). Check out past polls.

    Notices?