in reply to Re^3: Ternary Quizical behaviour?
in thread Ternary Quizical behaviour?
sometimes an example is clearer than many words:
the first arg to tst() is a scalar-ref, the second the scalar itself
DB<107> sub tst { print "ref of alias match: ".$_[0] if $_[0] == \ $ +_[1] ; $_[1] = 42 } DB<108> my $x =666; tst( \$x,$x); print "\n now x = $x" ref of alias match: SCALAR(0x339fb20) now x = 42
as you can see these are quite different concepts.
References are a datatype in Perl pointing to another thing.
Aliases are just the same thing by another symbolic name (sic).
And in fact, to prove it, that alias has even the identical reference!
compare also:
> never used the term alias to refer to a variable passed by reference.
well never too late! :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|