Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by ikegami (Pope)
on Mar 06, 2013 at 04:48 UTC ( #1021946=note: print w/replies, xml ) Need Help??


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

or
reduce { our $a * our $b } 1 .. 6;

Replies are listed 'Best First'.
Re^3: Name "main::a" used only once: possible typo
by szabgab (Priest) on Mar 06, 2013 at 05:16 UTC
    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;
      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://1021946]
help
Chatterbox?
[Corion]: marto: Oooh - cinema... I guess that's something I could do with my godson and sibling and sister as well, but I guess that getting a six year old and two four year olds into one movie is a tough sell ;)
[marto]: busy weekend, no me time :P
[Corion]: marto: Yeah, that's somewhat implied :) I was on the phone with my godson yesterday (they birthday), but I haven't seen them for two weeks now (vacation), relaxing, but I somewhat miss them too ;)
[Discipulus]: me waterpolo? oh no! i'm a no sport; the tournment was for the elder son
[karlgoethebier]: good morning
[Corion]: Discipulus: Ah, so he's the one getting almost drowned all the time - waterpolo certainly is no sport for me ;)
[karlgoethebier]: Corion: buy enough coke and popcorn...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-07-24 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (348 votes). Check out past polls.