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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4