develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Should we deprecate $; ?

Thread Previous | Thread Next
From:
david nicol
Date:
May 14, 2003 15:20
Subject:
Re: Should we deprecate $; ?
Message ID:
1052950817.1088.77.camel@plaza.davidnicol.com

if nobody beats me to it I'll write a sentence or 2 to
insert into perlvar to suggest using $h{(),@a} when you
want to get the multiple emulated dimensions out of an
array.


I use the feature often and find it handy.  The syntax is
nice; I would not want to throw away $; without replacing it
with something else that will understand $h{(),@a} as a
multidimensional hash key.  And I can't OTTOMH produce one
that would not involve eval-stringing a joined map result.




On Tue, 2003-05-13 at 16:56, Rafael Garcia-Suarez wrote:
> $; is the subscript separator for multidimensional array emulation
> (as says perlvar).  Basically it works like this :
> 
>     $ perl -MO=Deparse -e '$x{1,2}'
>     $x{join $;, 1, 2};
> 
> In our Unicode and UTF8 world, it's becoming more and more unsafe to use
> that kind of hack, esp. when better alternative solutions are available.
> 
> I therefore suggest to add to 5.9 a deprecation warning
> 
>     "Use of multidimensional array emulation is deprecated"
> 
> for any use of the implicit join($;,...).
-- 
David Nicol, independent consultant and contractor
have a nice day, really. http://www.funnytimes.com 



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