in reply to Re: Implicit references? module -> feature -> pragma -> "Perl8" ?
in thread Implicit references? module -> feature -> pragma -> "Perl8" ?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Implicit references? module -> feature -> pragma -> "Perl8" ?
by Tux (Canon) on May 13, 2026 at 14:11 UTC | |
by LanX (Saint) on May 13, 2026 at 14:24 UTC | |
by Tux (Canon) on May 13, 2026 at 14:38 UTC | |
by LanX (Saint) on May 13, 2026 at 14:41 UTC |