http://www.perlmonks.org?node_id=789690

vinoth.ree has asked for the wisdom of the Perl Monks concerning the following question:

use strict; use warnings; use Data::Dumper; my $hash_ref={1002=>[1,2,3,4,5],1001=>[6,7,8,9,10],3=>[2]}; my ($key,$val); foreach(($key,$val)=each %$hash_ref){ print "Each()=======================>$key=>$val<================== +=====\n"; print "Default>>>>>>>>>>>>>>>>$_<<<<<<<<<<<<<<<<<<\n"; }

I just tried to get the pair of key and value from the hash reference, I got what I want using the while loop, when I go for 'foreach' I count not understand what is happening ? Any idea pl!

Update

Title changed.