perlquestion
vinoth.ree
<c> 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";
}
</c>
<p>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! </p>
<b>Update</b>
<p>Title changed.</p>