On Jan 22, 2008 9:33 PM, Rob Dixon <[EMAIL PROTECTED]> wrote:
snip
> > If the code works (and it isn't guarenteed to)
>
> I'm not sure what you mean here. It's as guaranteed to work as any other
> Perl code snippet I've seen.
snip
I mean that the following is an error.
my $foo = 5;
my @array = @{$foo};
And that since I have no way of knowing $y holds, those lines of code
may or may not work. Perl will do the Right Thing(tm), but that isn't
that same as working.
snip
> > then $y holds a reference to an array and @{} is being used to
> > corerce it into behaving like an array (i.e. dereferencing it).
>
> It's not coercing $y to do anything. It's accessing the array to which
> $y refers.
snip
It doesn't access it any more than it coerces it. The proper term is
dereference; however, coerce and access act as very good descriptions
of what dereferencing means (making a reference return the value it
points to). Since I couldn't assume he knew what dereferencing was, I
used a similar word that I hoped would trigger the right thought
patterns and then gave him the proper word.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/