in reply to Re^3: That damn "strict"
in thread That damn "strict"

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

Replies are listed 'Best First'.
Re^5: That damn "strict"
by si_lence (Deacon) on Jan 10, 2006 at 08:29 UTC
    hmmm, for me your code does cause an error
    adding a semicolon after the first line fixes this
    or am I missing the obvious?
    si_lence
      whoops.. that's not what i meant, i just missed the semicolon. (updated)

      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
Re^5: That damn "strict"
by ysth (Canon) on Jan 10, 2006 at 08:30 UTC
      That shouldn't make the strong weep. Reserve that for figuring out things like qq}$foo{bar\}}. Or somewhat more sanely, something like this: qq{let's have an unbalanced \{ here.}

      But that does bring up an important note. If you know that you'll want a quote with, say, unbalanced parens, then use a different balanced delimiter. For instance () above. (For me this mostly comes up with my having to use {} when I want unbalanced parens.)

Re^5: That damn "strict"
by tilly (Archbishop) on Jan 10, 2006 at 18:27 UTC
    I use qq a lot as well, but mainly for whole blocks of text.