Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Dump the key value pairs in a hash

by choroba (Cardinal)
on Oct 22, 2021 at 20:21 UTC ( [id://11137900]=note: print w/replies, xml ) Need Help??


in reply to Dump the key value pairs in a hash

$self is a scalar variable, so it's not a hash, it's a reference to a hash. You need to dereference it to get the hash:
print map { "Key: $_ has Value:$self->{$_}\n" } keys %$self; # ~~ ~

Or, use Data::Dumper:

use Data::Dumper; ... print Dumper($self);

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-03-29 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found