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

Re: Should we deprecate $; ?

Thread Previous | Thread Next
From:
Abigail
Date:
June 25, 2003 04:56
Subject:
Re: Should we deprecate $; ?
Message ID:
20030625115647.GL4808@abigail.nl
On Tue, May 13, 2003 at 11:56:50PM +0200, 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($;,...).


Please don't. Regexp::Common heavily relies on multidimensional
hash emulation. It allows you to write stuff like:

    /$RE{num}{int}{-group => 4}/

Having to write that as:

    /$RE{num}{int}{join $;, -group => 4}/

takes away much of the charm of the module, making it much harder
to read what's going on.


Abigail

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