I personally would have preferred° to have
for my $id (@ids) { my $data = $datas{$id}; # or $data_of{} ¹ ... }
or are you planing to later write my $id = $id{$id} when accessing the values?
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
°) Actually depending on context I would prefer more specific names than id and data unless the surrounding is very clear and small. Like $person_id and $address{$person_id}
When reading a large code base again and again it's nice to immediately distinguish the hashes in different subs.
¹) using plural for hashes is actually not PBP (IIRC?), not sure how best to solve it.
%id_data is a bit redundant, but clearer than %data_of or %data4
In reply to Re^2: Implicit references? module -> feature -> pragma -> "Perl8" ?
by LanX
in thread Implicit references? module -> feature -> pragma -> "Perl8" ?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |