in reply to Re: grep of readline matching more lines than elements in array
in thread grep of readline matching more lines than elements in array

I can only agree with the excellent advice offered by Kenosis, you should really follow them, they will save you a lot of debugging time. There is just one point in the re-factored code which could be improved in my view:
my %isos20 = map { $_ => 1 } @isos20;
I would give a different name to the hash and the array. Granted, Perl can manage this without any problem, and it will work without any problem in the case in point. But giving the same name to two different entities can lead to difficult to track bugs with more complicated data structure. Sometimes, you goof your data dereferencing and the Perl compiler would be able to tell you about your error if each data structure had its own name, but it does not see the error if two different entities have the same name, so that you get the error at run time instead of compile time, or, worse, that you are not using the data you thought you were using.

Replies are listed 'Best First'.
Re^3: grep of readline matching more lines than elements in array
by Kenosis (Priest) on Dec 04, 2013 at 01:19 UTC

    Excellent hash-naming suggestion, Laurent_R. Thank you for adding this.