if (exists $hash{$l} and @{$hash{$l}}>0) { print "Hash value of $l is $hash{$l}->[0]\n"; #or the short form $hash{$l}[0] } else { print "Nothing found for $l\n"; }