develooper Front page | perl.perl5.porters | Postings from December 2015

Re: [perl #127063] Setting $[ = 0 should not generate a warning

Thread Previous | Thread Next
From:
Zefram
Date:
December 29, 2015 00:34
Subject:
Re: [perl #127063] Setting $[ = 0 should not generate a warning
Message ID:
20151229003355.GH7818@fysh.org
>On Mon Dec 28 14:19:28 2015, jim.avera@gmail.com wrote:
>This warning makes some old code noisy even if the only thing the code does
> is to set $[ to zero to to protect against callers leaving $[ in another
>state (which was possible Perl 4, at least).

It is not possible in Perl 5.  $[ has been lexically scoped since 5.000.
The only purpose of assigning to $[ in Perl 5 is if the code is actually
Perl 4 code, and needs to remain runnable on Perl 4.

-zefram

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