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

Thank you well explanation.
my%hash = (Script => "Perl", script_1=>"Ruby", script_2=> "PHP"); for my$k (keys %{my$href}) { print "$k => ${$href}{$k}\n"; }
it showing Global symbol $href requires explicit package name.why this error.?

Replies are listed 'Best First'.
Re^5: Hash in Perl
by Anonymous Monk on Jan 02, 2014 at 07:17 UTC

    it showing Global symbol $href requires explicit package name.why this error.?

    because you're copy/pasting the wrong things , without understanding what they mean

    Why do you introduce $href? Think about that

    Then see the documentation for keys function, how is it different from your example?

    Try keys %hash