develooper Front page | perl.perl6.language | Postings from July 2001

Re: aliasing a value in a while each loop

From:
Eric Roode
Date:
July 20, 2001 13:47
Subject:
Re: aliasing a value in a while each loop
Message ID:
200107202047.QAA22480@verne.myxa.com
David L. Nicol wrote:
>
>Are there really situations where
>
>	$$reference = An Expression;
>
>is clearer than
>
>	$reference = \(An Expression);
>
>?

Eric is confused. I don't know about in Perl 6-to-be, but in Perl 5
those two mean totally different things:

   $foo  = \$bar;         # sets $foo to be a ref to $bar
   $$foo = "hi mom";      # sets $bar to "hi mom"
   $foo  = \"hi mom";     # sets $foo to be a ref to "hi mom"
   
 ----------------------------------------------------------------------
 Eric J. Roode                                            eric@myxa.com
 Senior Software Engineer, Myxa Corporation




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About