#ref_exercise2.pl
%hash1 = ( name => 'Paul',
age => 21,
cellphone => '0922222222',
birthday => '1982/3/21' );
%hash = ( name => 'John',
age => 24,
cellphone => '0911111111' );
@array_hash = (\%hash1,\%hash);
for $hash_ref (@array_hash){
print ${$hash_ref}{birthday}."\n";
if (!${$hash_ref}{birthday}){print "DOES NOT EXIST!\n"}
}
沒有留言:
張貼留言