Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Hash in Perl

by Lennotoecom (Pilgrim)
on Jan 02, 2014 at 07:20 UTC ( [id://1068915]=note: print w/replies, xml ) Need Help??


in reply to Re: Hash in Perl
in thread Hash in Perl

because $href you're using is not defined
at least in this snippet
for my $k (keys %hash) { print "$k => $hash{$k}\n"; }

Replies are listed 'Best First'.
Re^3: Hash in Perl
by rammohan (Acolyte) on Jan 02, 2014 at 07:26 UTC
    Ya but in perldoc showing like
    for my $key (keys %{$href}) { print "$key => ${$href}{$key}\n";
    this also please see and tell me http://perldoc.perl.org/perlreftut.html
      my %hash = (Script => "Perl", script_1=>"Ruby", script_2=> "PHP"); $href = \%hash; for my $k (keys %{$href}) { print "$k => ${$href}{$k}\n"; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-25 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found