Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: How do I find out which variables I'm not using?

by Prior Nacre V (Hermit)
on Nov 06, 2004 at 02:57 UTC ( [id://405685]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How do I find out which variables I'm not using?
in thread How do I find out which variables I'm not using?

I agree with your sentiments on strict.

I often test things like regexes from the commandline before adding to application code. I always include warnings and strictures in these tests:

perl -we 'use strict; ...'

Whenever I fiddle with these in a script or module, I tend to go into blatently-obvious-defensive-progamming mode:

NO_ONCE_ONLY_WARNINGS_ZONE: { no warnings qw(once); . . . use warnings qw(once); }

I am often told this is overkill: usually by people that do a lot more debugging than me :-)

Regards,

PN5

Replies are listed 'Best First'.
Re^4: How do I find out which variables I'm not using?
by Aighearach (Initiate) on Nov 06, 2004 at 03:07 UTC
    Yes nice! But note that, you don't need to use warnings qw(once) because the warnings provided by the warnings pragma are lexical, and you've got them enclosed in that block. So there IS some overkill there. I do like the block, so I wouldn't call the most of it overkill.

    But does NAMING the block ever tempt you to goto LABEL??? I always am tempted, and grin mischieviously, and then I have to say 100 Hail Larry's to forgive myself.


    --
    Snazzy tagline here

      Both the label and the use() statement are technically unnecessary; or, conversely, the label and the block are unnecessary. I am aware of this but use them anyway. It's all part of the defensive progamming strategy.

      I would rather <insert your own nightmarish ineffability here> than type goto LABEL :-)

      Regards,

      PN5

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found