Funny - I do it exactly the opposite. I use singles unless I need double, because then interpolating happens only when I say so, and I otherwise don't have to pay attention to sigils or other special characters. When interpolation happens, then I have to scan the line to figure out if I want to go and escape everything, or if I leave it as-is, and use the concatentation operator '.'. As far as obviousness, I suggest a syntax-highlighting editor. ;-)
| [reply] |
I second your recommendation to use a syntax-highlighting editor, but I want to expand. Not all editors (even fte, sadly, which I loved) handle complex quoting in Perl in a sane manner. For example, an editor might have trouble with some of:
qq[];
s///;
y///; ##and so on, any with three separators
s[][]; ##etc
m,/,; ##non-standard matching, esp with a slash
m/\//; #matching with an escaped version of a delimeter
The only editor I've ever found that handles all of those correctly is SciTE.
radiantmatrix
require General::Disclaimer;
s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}
| [reply] [d/l] |
FYI - FTE handles all those just fine. It's not perfect, but those particular types are working currently. I've fixed many of the perl syntax highlighting problems in FTE, but I don't think any of those ever had a problem that I had to fix.
| [reply] |
| [reply] [d/l] |
I also lean toward sticking with 's. For the "only interpolate when I really mean it" reason as well as my probably unfounded fear of a performance hit on "s.
Doug
| [reply] |
You could use q"blah" instead of single quotes. You'd have the obviousness of double quotes, and if you needed to make it interpolate, you just remove the q.
What could be more straightforward? ;-)
Caution: Contents may have been coded under pressure.
| [reply] [d/l] |
Remove the q? I prefer to use qq'blah' when I need interpolation.
;)
| [reply] |