Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Four annoying warnings

by tobyink (Abbot)
on Dec 09, 2012 at 00:59 UTC ( #1007940=note: print w/ replies, xml ) Need Help??


in reply to Re: Four annoying warnings
in thread Four annoying warnings

perl -M-warnings=uninitialized,numeric,once,void -E"123;$x=1;print $y; 'A'+0"

But with strict that already doesn't compile. When you use strict, "once" usually becomes pretty irrelevant.

"(My point being that args to no warnings;can be meultiple: no warnings qw[uninitialized numeric once void];"

I'm aware of that. The four line block of the code was intended as four individual examples of how to disable specific warning categories, rather than a single block that should be copied and pasted into actual scripts.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re^2: Four annoying warnings
Select or Download Code
Replies are listed 'Best First'.
Re^3: Four annoying warnings
by chrestomanci (Priest) on Dec 11, 2012 at 17:01 UTC
    But with strict that already doesn't compile. When you use strict, "once" usually becomes pretty irrelevant.

    Mostly yes, but not if you refer to a fully qualified varable from another package. For example, when I am debugging my code, I often put DB::single=1 at various places. Sometime I leave those line in production code inside assert like error checks, as a kind of assert that will only go off when debugging.

    I have found that those lines will trigger the "once" warning, which is irritating.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (13)
As of 2015-07-31 10:45 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 (276 votes), past polls