|There's more than one way to do things|
RFC: Idiom for named read-write arguments (aliases) instead of using $_ etcby LanX (Canon)
|on Sep 01, 2012 at 21:39 UTC||Need Help??|
is that idea new?
for completeness, this works too:
UPDATE: I was asked if this example accomplishes anything that the following doesn't:
no it doesn't ¹) I just wanted to meditate about a pattern to have named aliases.
Compare PBP's critic about using unreadable variables like $_.
of course swap() is too short to profit from named arguments.
¹) except by not dieing on literals.