Description
return sum map { ... } @list seems to compile OK under strict without the import of List::Util::sum and returns a filehandle and a mapped list.
Steps to Reproduce
This program shows the behavior:
use warnings;
use strict;
use Data::Dumper;
# use List::Util qw{ sum };
sub xx { return sum map { $_ + 1 } 1 .. 5 }
print Dumper(xx);
The actual error occurs only after you remove return. Removing map causes it to report a warning, but it still runs.
Expected behavior
I expected to get an error about invalid bareword under strict mode, same as without return.
Perl configuration
Behavior is consistent on both perl 5.10.1 and 5.38.2.
Description
return sum map { ... } @listseems to compile OK under strict without the import ofList::Util::sumand returns a filehandle and a mapped list.Steps to Reproduce
This program shows the behavior:
The actual error occurs only after you remove
return. Removingmapcauses it to report a warning, but it still runs.Expected behavior
I expected to get an error about invalid bareword under strict mode, same as without
return.Perl configuration
Behavior is consistent on both perl 5.10.1 and 5.38.2.