in reply to Re: In Love With Double Quotes
in thread In Love With Double Quotes

For engineering reasons, I use single-quotes when I mean to use a literal, and double-quotes when I mean to interpolate. It's just a matter of doing what you're saying, and saying what you're doing.

If I want to use a string constant, I use single quotes. No ambiguity. No mental gymnastics trying to figure out what '@$_$@#!!' means. It's a curse. Ok, so that doesn't come up too often. However, other interpolations, such as 'someone@somewhere.com', are quite frequent.

If I want to interpolate strings, I use double quotes. No ambiguity. It's just a simple acknowledgement that I know what I'm doing, and what I'm doing is interpolation.

People who mindlessly use only a single tool probably don't know there are other tools out there, and, moreover, probably don't really know their own tool properly. If you insisted on using double-quotes everywhere in your code while you worked for me, and in the style you present above, I'd have your attitude for supper. It's simply not conducive to either the workplace or perlmonks.

Replies are listed 'Best First'.
Re^3: In Love With Double Quotes
by Anonymous Monk on Aug 09, 2005 at 08:49 UTC
    Of course, one use double quotes when you want to interpolate, and single quotes when you don't. No question about that. The topic however is the large set of strings where "are we interpolating or not" isn't a sensible question. Are you interpolating in "Hello, world"? Perhaps you are, it just happens the set of variables you are interpolating happen to be zero. For me, double quotes also mean "I'm interpolating". But often, I interpolate zero variables.