in reply to That damn "strict"

I read some recent post here to the effect that "you don't have to use strict if you know what you're doing", I couldn't disagree more.

Not to necessarily contradict your advice, but often times when I say something like, "you don't have to use strict all the time," I mean that sometimes it's honestly, for reals, truly ok to turn it off here and there. Using the no pragma. In a tight scope. Sparingly. :-)

Replies are listed 'Best First'.
Re^2: That damn "strict"
by dragonchild (Archbishop) on Sep 16, 2005 at 01:07 UTC
    To further elaborate, I would put forward that one should turn off the specific aspect of strict you wish to violate within that specific block. Don't no strict; when you really mean no strict 'refs';.

    This is very similar to when I use which quoting mechanism. I use single-quotes nearly exclusively, except when I either have to use single-quotes within that string or if I'm interpolating a variable. And, double-quotes, to me, specifically indicate that one of those two situations is occurring. (This has caused me no end of grief in Javascript because IE won't auto-create a String object from a string created with single-quotes, only one created with double-quotes.)


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      I have the opposite quoting problem.

      I am in the habit of always quoting with ", so that I won't have to change it if I later decide to interpolate a variable.

      Which gives me no end of grief when it comes to SQL, because I constantly use " for strings and then wonder why it is complaining about my identifiers.

        lately started a job working with somebody who had written piles of code using qq{Look Ma! Double quoted string!} construct. it's a habit i think i may adopt, solves precisely this problem

        at one point, doing interpolation with a hash (for, perhaps, the 1000th time that day) a la:

        my %hash=(foo=>1); print qq{$hash{foo}};
        i wondered very intensely why that doesn't cause a syntax error, but then i came to my senses and stopped really caring ....

        It's not what you look like, when you're doin' what you’re doin'.
        It's what you’re doin' when you’re doin' what you look like you’re doin'!
             - Charles Wright & the Watts 103rd Street Rhythm Band