[LA.pm] Double versus single quotes

Douglas Wilson dgwilson at gtemail.net
Tue Nov 25 16:20:00 CST 2003


From: "John W. Palmieri" <john at mediaOnFire.com>

> 
> When I'm using strings in Perl I try to use single quotes 
> for static strings (e.g., 'This string is static') since I 

> Also, when building an output string I'll tend to use long 
> static strings followed by the dot (.) concatenator for 
> inserting variables using the same reasoning. I'm asking 
> this question since I've come around that this may not be 
> the most efficient since with every concatenation it may 
> have to do exec a bunch of constructors and copies?

Run your script through B::Deparse like this:
perl -MO=Deparse,-q script_name_here

You'll see that double quoted strings containing nothing
but constants are just interpreted as single quoted
strings anyway, and double quoted strings containing
variables are interpreted as '.' concatenated strings.

HTH,
Doug

-- 
_______________________________________________
Get your free Verizonmail at www.verizonmail.com




More information about the Losangeles-pm mailing list