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
print for @{ my $x }; doesn't report "Can't use an undefined value..." #11270
Comments
From contact@johnbokma.comCreated by contact@johnbokma.comperl -e 'use strict; use warnings; print for @{ my $x }' This is perl, v5.8.8 built for x86_64-linux-thread-multi perl -e 'use strict; use warnings; print for @{ my $x }' This is perl, v5.10.0 built for x86_64-linux-gnu-thread-multi The behaviour in 5.10.0 seems unexpected. When I posted this bug Perl Info
|
From @iabynOn Wed, Apr 20, 2011 at 06:21:14PM -0700, John Bokma wrote:
Bisect shows the error went away with this commit: commit a62b51b Re: my $x->{foo} doesn't work So it looks like it was deliberate. -- |
The RT System itself - Status changed from 'new' to 'open' |
From contact@johnbokma.comOn Thu Apr 21 03:36:11 2011, davem wrote:
Thanks Dave. What I don't understand, but that has a lot to do with not knowing a perl -e 'use strict; use warnings; my $x; for ( @$x) { print }' but: perl -e 'use strict; use warnings; my $x; print while @$x' |
From @ikegamiOn Wed, Apr 20, 2011 at 9:21 PM, John Bokma <perlbug-followup@perl.org>wrote:
Dereferences of undefined scalars in lvalue context result in Just like the argument list of sub calls, The list over which foreach Autovivification often creates unexpected behaviour, but it is intended $ perl -we'my $x; @$x = qw( a b c );' $ perl -we'@{ my $x } = qw( a b c );' $ perl -we'my $x; for (@$x) {}' $ perl -we'for (@{ my $x }) {}' $ |
From contact@johnbokma.comOn Thu Apr 21 11:11:03 2011, ikegami@adaelis.com wrote:
To me this is too much magic. Is this on the list of changes between 5.8 |
From contact@johnbokma.comEric, I have given it some more thought. I do think that this makes Perl more Thanks for the explanation, |
@cpansprout - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#89024 (status was 'rejected')
Searchable as RT89024$
The text was updated successfully, but these errors were encountered: