Mark_Galeck wrote:
Why does

$foobar = \("foo", "bar");
print $$foobar;


print "bar"  ??

Thank you for any insight.  Mark

Because \("foo", "bar") is really (\"foo", \"bar") and the comma operator in scalar context will return the last item listed so:

$foobar = \("foo", "bar");

Is just:

$foobar = \"bar";




John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to