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
for(@a) optimisation causes problems #10436
Comments
From @cpansprout$ perl -le' @a = (1,2,3); print shift @a for @a' $ perl -le' @a = (1,2,3); print shift @a for (),@a' There seems to be some optimisation for ‘for @array’ that has strange This can sometimes cause action-at-a-distance: And, apparently, I’m not the only person to have run into this. I sub _collapse_single_option_selects { my @to_collapse; my @options = $select->options(); next if @options != 1; push @to_collapse, [ $select, $options[0] ]; # Modifying the dom as we loop through it seems to cause weirdness See that comment. A simple ‘for my $select( (), @{...} )’ would have Use of uninitialized value $category in concatenation (.) or string Flags: Site configuration information for perl 5.13.1: Configured by sprout at Sun Jun 6 14:31:27 PDT 2010. Summary of my perl5 (revision 5 version 13 subversion 1 patch Locally applied patches: @INC for perl 5.13.1: Environment for perl 5.13.1: |
From @iabynOn Sun, Jun 13, 2010 at 06:23:30PM -0700, Father Chrysostomos wrote:
The first one iterates over the elements of an array, the second over the -- |
The RT System itself - Status changed from 'new' to 'open' |
From @cowensOn Sun, Jun 13, 2010 at 21:23, Father Chrysostomos
This a documented as a bad thing to do in [perlsyn][1]: If any part of LIST is an array, foreach will get very confused if you [1] : http://perldoc.perl.org/perlsyn.html#Foreach-Loops -- |
@iabyn - Status changed from 'open' to 'stalled' |
Migrated from rt.perl.org#75720 (status was 'stalled')
Searchable as RT75720$
The text was updated successfully, but these errors were encountered: