in reply to newer Perl version rejects this

As posted that won't work on any build!

  1. The while block is never closed: while(<$fh>) { ie. Missing '}'.
  2. And if you closed the block like this:
    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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked