Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: foreach keys possible using a hash reference?

by amphiplex (Monk)
on Jul 04, 2002 at 17:04 UTC ( [id://179497]=note: print w/replies, xml ) Need Help??


in reply to foreach keys possible using a hash reference?

this should do:
my %h = ( 'a' => 1, 'b' => 2, 'c' => 3, ); print_hash(\%h); sub print_hash { my $h = shift; for (keys %$h) { print "$_: $h->{$_}\n"; } }
---- kurt

Log In?
Username:
Password:

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

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

    No recent polls found