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 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.my %isos20 = map { $_ => 1 } @isos20;
|
|---|
| 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 |