Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Name "main::a" used only once: possible typo

by szabgab (Priest)
on Mar 06, 2013 at 05:16 UTC ( #1021953=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Name "main::a" used only once: possible typo
in thread Name "main::a" used only once: possible typo

I'd probably put the our ($a,$b) outside of that block, but this is what I had in mind. I was just interested in more options. - Thanks

out ($a, $b); reduce { $a * $b } 1 .. 6;


Comment on Re^3: Name "main::a" used only once: possible typo
Download Code
Re^4: Name "main::a" used only once: possible typo
by AnomalousMonk (Abbot) on Mar 11, 2013 at 17:27 UTC
    I was just interested in more options.

    This is kind of old-school and amounts to the same thing as sticking an  our ($a, $b); statement somewhere, but it's another option:

    >perl -wMstrict -le "use List::Util qw/reduce/; use vars qw($a $b); ;; print reduce { $a * $b } 1..6; " 720

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2015-07-06 14:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls