Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^2: To Single Quote or to Double Quote

by Tanktalus (Canon)
on Feb 01, 2005 at 21:18 UTC ( #427055=note: print w/replies, xml ) Need Help??

in reply to Re: To Single Quote or to Double Quote
in thread To Single Quote or to Double Quote

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. ;-)

  • Comment on Re^2: To Single Quote or to Double Quote

Replies are listed 'Best First'.
Re^3: To Single Quote or to Double Quote
by radiantmatrix (Parson) on Feb 01, 2005 at 21:51 UTC

    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.

    require General::Disclaimer;
    s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}

      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.

      My Windows editor of choice handles all of that just fine. I wish they made a Linux version.

      Linux, sci-fi, and Nat Torkington, all at Penguicon 3.0
      perl -e 'print(map(chr,(0x4a,0x41,0x50,0x48,0xa)))'
Re^3: To Single Quote or to Double Quote
by NateTut (Deacon) on Feb 02, 2005 at 00:25 UTC
    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.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://427055]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-10-21 09:37 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (83 votes). Check out past polls.