Great summary. Personally, I find the following:
@{$aRefs[0]} @{$aRefs{key}} @{getArrayRef()} %{$hRefs[0]} %{$hRefs{key}} %{getHashRef()}
much cleaner and easier to read than:
@array @$aRef %hash %$hRef $array[0] $$aref[0] $hash{KEY} $$href{KEY}
Maybe it's just me, but I've been using perl for 4+ years and I have never liked stringing the variable characters one after the other (%$). Particularly epxressions like the third and fourth line in the second group above.
I've always thought that using the @{ } %{ } syntax more clearly and consistently evoked what I'm trying to say -- you can use it with variables, method calls/subroutines, etc. I'm interested if other folks feel differently -- it seems to be a matter of taste rather than an opportunity to define yet another One True Way :-)
Chris
M-x auto-bs-mode
In reply to Re: References quick reference
by lachoy
in thread References quick reference
by tye
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |