Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by tobyink (Abbot)
on Jul 30, 2013 at 20:29 UTC ( #1047115=note: print w/replies, xml ) Need Help??


in reply to Re^2: Eliminating "used only once" warnings from List::Util::reduce
in thread Eliminating "used only once" warnings from List::Util::reduce

Yes, the reason it happens after the BEGIN stage rather than during, when most compile-time warnings are issued, is that Perl needs to check the whole lexical scope (i.e. file probably) before it can issue any warnings about variables being used only once. (Because until it's got to the end of the scope it cannot be sure they were only used once.)

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
  • Comment on Re^3: Eliminating "used only once" warnings from List::Util::reduce

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047115]
help
Chatterbox?
and the pool shimmers...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2017-03-25 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (311 votes). Check out past polls.