[root@yun1 test]# cat a1.pl
my $h={'192.168.11.187'=>['root','1234567'],
'192.168.5.7' =>['root','cdsxxxkfdsfsdf'],
'192.168.5.3'=>['root','dxxxxxfa']};
foreach $key (keys %{$h}) {
print "$key is $key
";
print $h->{$key}->[0];
print "
";
print $h->{$key}->[1];
print "
";
print "------------------
";
};
[root@yun1 test]# perl a1.pl
$key is 192.168.5.7
root
cdscccc
------------------
$key is 192.168.11.187
root
1234567
------------------
$key is 192.168.5.3
root
tttt
------------------