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 :-)



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 :-)