develooper Front page | perl.perl6.language | Postings from August 2005

Re: @array = $scalar

Thread Previous | Thread Next
From:
mark.a.biggar
Date:
August 31, 2005 13:30
Subject:
Re: @array = $scalar
Message ID:
083120051550.9973.4315D1AB000B0CFA000026F522073007939D0E0909070DD20ED2059D0E03@comcast.net
I think this deserves at least a compile time warning and also a strict pragma to make it an error as it is most likely not what the programmer wanted.

--
Mark Biggar
mark@biggar.org
mark.a.biggar@comcast.net
mbiggar@paypal.com


> Ingo Blechschmidt skribis 2005-08-31 13:22 (+0000):
> >     @array = $arrayref;                  # really means 
> >     @array = ($arrayref,);               # same as 
> >     @array = (); @array[0] = $arrayref;  # thus 
> >     say +@array;                         # always 1 
> >     # Correct? 
> 
> Yes, although at some point there was this weird notion of scalars
> automatically dereferencing in list context, in this respect Perl 6
> currently is sane.
> 
> 
> Juerd
> -- 
> http://convolution.nl/maak_juerd_blij.html
> http://convolution.nl/make_juerd_happy.html 
> http://convolution.nl/gajigu_juerd_n.html

Thread Previous | Thread Next


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