Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Eliminating "used only once" warnings from List::Util::reduce

by Khen1950fx (Canon)
on Jul 30, 2013 at 06:46 UTC ( #1046955=note: print w/ replies, xml ) Need Help??


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;


Comment on Re: Eliminating "used only once" warnings from List::Util::reduce
Download Code
Re^2: Eliminating "used only once" warnings from List::Util::reduce
by davido (Archbishop) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2014-07-14 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (252 votes), past polls