New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local($^W) does not work correctly #5835
Comments
From jima@simplex.comCreated by jima@simplex.com# local() doesn't seem to work correctly with $^W in Perl 5.6.1
# Run this program to see.
# -Jim Avera jima@simplex.com 8/15/2002
use strict;
#------ this works ------
use vars '$XX';
$XX = 1;
die "BUG: XX is off" unless $XX;
{ local($XX) = $XX;
die "BUG: XX is off" unless $XX;
}
die "BUG: XX is off" unless $XX;
#------ this doesn't work ------
$^W = 1;
die "BUG: warn is off" unless $^W;
{ local($^W) = $^W;
die "BUG: warn is off" unless $^W; # dies here in Win32 Perl 5.6.1
}
die "BUG: warn is off" unless $^W; # dies here in Solaris Perl 5.6.1
print "Test passed.\n"; Perl Info
|
From @schwernConfirmed in 5.8.0 and 5.8.1 RC2. |
@schwern - Status changed from 'new' to 'open' |
From @HugmeirOn Tue Jul 15 23:16:04 2003, schwern wrote:
This is still present in 5.14.2 and blead, but a small update: The { local( |
From @cpansproutOn Sat Apr 28 02:11:01 2012, Hugmeir wrote:
Knowing how this is implemented, I think it was misdiagnosed.
Usually, local($foo) creates a new $foo in *foo{SCALAR}, copies the local($foo) = $foo works because the $foo on the RHS (which is executed For magical variables things gang agley, because the local($^W) on the This is similar to bug #104118, but a little different; but I think it’s -- Father Chrysostomos |
From @cpansproutOn Sat Apr 28 13:56:58 2012, sprout wrote:
I forgot to mention that local($hash{elem}) in lvalue context is -- Father Chrysostomos |
From @maukeCreated by @mauke
I would have expected the first version to output "after: 123" instead of
i.e. the reset isn't even localized; it straight up clobbers $?. This bug interacts badly with END blocks:
instead of the expected:
Perl Info
|
From @ikegamiAlso affects Windows and cygwin, so it's not OS specific. |
The RT System itself - Status changed from 'new' to 'open' |
@ikegami - Status changed from 'open' to 'new' |
Migrated from rt.perl.org#16235 (status was 'open')
Searchable as RT16235$
The text was updated successfully, but these errors were encountered: