As posted that won't work on any build!
while(<$fh>) { my %hash = map{ chomp; split/ /; $_[1] => $_[0];} <$fh>; } print$hash{20}; #prints CHASE
It wouldn't work because you read one line at the top of the loop throw it away; then read the rest of the lines into the map.
But even if you don't care about the first line it still won't work because the hash is defined inside the loop and will disappear as soon as you exit it.
Bottom line is: your code is broken wherever you try to run it.
In reply to Re: newer Perl version rejects this
by BrowserUk
in thread newer Perl version rejects this
by ggadd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |