Symbolic references are just implicit hash lookups, doing them explicitly is better in the vast majority of cases.
The for-solution you showed is aliasing which has similarities to referencing, but should not be confused.
> Now $_ = zeropad($_) for $sec, $min, $hour, $day, $month;
> OTOH? That's what I'm talking about!
No you weren't.
But FWIW, aliasing it's also feasible with hash values.
Consider
$_ = zeropad($_) for values %time
and revaluate the clarity of concise code.
Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery
In reply to Re^3: What's so wrong with this (dereferencing)code? (Aliasing / UPDATED)
by LanX
in thread What's so wrong with this (dereferencing)code?
by Maelstrom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |