use strict;
use warnings;
my @array = qw(a b c d);
printArray (\@array);
sub printArray {
my $aref = shift;
print "First element by ref = " . $aref->[0] . "\n";
print "First element by sugar = " . $$aref[0] . "\n";
}
Prints:
First element by ref = a
First element by sugar = a
Appart from that, at the end of the day I don't think aliasing is going to get you a lot except some pain. The keystrokes saved just won't add up to enough to compensate for the bugs that are bound to be introduced by obfusicating your code in that fashion - unless that is the intent of course. :)
Update: Oh, package variables. Perl does have some nasty surprises doesn't it :)
DWIM is Perl's answer to Gödel
|