szabgab has asked for the wisdom of the Perl Monks concerning the following question:
Genetates the following warnings:use strict; use warnings; use List::Util qw/reduce/; print reduce { $a * $b } 1..6;
OTOHName "main::a" used only once: possible typo at x.pl line 6. Name "main::b" used only once: possible typo at x.pl line 6.
does not generate the warnings. As expected. (running perl 5.14.2 and List::Util 1.27)use strict; use warnings; print sort {$a <=> $b } 1..6;
Why did the first example generate the warnings?
What is the recommended way to silence them?
Why is this not mentioned in List::Util?
Back to
Seekers of Perl Wisdom