Code:
%a = ( 1 => "ONE" ,
2 => "TWO" ,
3 => " Three", );
$test_value = 1 ;
foreach $key (sort(keys %a)) {
if ($key == $test_value ) {
print $a{$key};
}
}
I just want to achieve the same operation in very short way. Is there any shortcut for this?