http://www.perlmonks.org?node_id=1046955


in reply to Eliminating "used only once" warnings from List::Util::reduce

This is the type of bug that makes Perl enormously interesting for me. Here's my last attempt:
#!/usr/bin/perl -l use strict; use warnings; use List::Util qw/reduce/; our($a, $b) = @_; my $reduce = reduce { $a + $b; } 1, 2, 3, 4; print $reduce;

Replies are listed 'Best First'.
Re^2: Eliminating "used only once" warnings from List::Util::reduce
by davido (Cardinal) on Jul 30, 2013 at 18:45 UTC

    Slick, however the point of the question was missed. If I wanted to solve it in "user code", there are at least a half dozen ways to do it. The question is dealing with how to solve it in either the module's code or perl code.


    Dave