Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
[Discipulus]: oh thanks, i'm always at well as the ratchet or bucket
[Corion]: But I'm slowly starting to get into programming again - yesterday I translated my talk for YAPC::E (in Amsterdam) to English, and decided to put my Jekyll-clone to rest for the time being
[Corion]: Discipulus++ # being well is like being earnest
[marto]: hopefully next year I'll be in a position to go to Perly things in Europe :)
[Corion]: Maybe I'll use the Real Jekyll a bit to get a feel for how it actually works, and to get annoyed by it ;)
[Corion]: marto: That would be cool :) There is no kids care at Perly events unfortunately, so it's not entirely family friendly
[Corion]: I think I should define a set of (say) five projects through which I rotate from time to time, just to prevent myself from being bored/annoyed by the problems they get stuck in ;)
[marto]: Corion, not bringing the kids would make it ideal :P
[marto]: a suggestion, have one project in the list that isn't programming/perl related
[Corion]: marto: Yeah, things are more parent-friendly the way they are ;))

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
























    Results (404 votes). Check out past polls.