[Melbourne-pm] Single vs double quotes: no real difference (was Re: Delivering PDFs via CGI)

Sisyphus sisyphus1 at optusnet.com.au
Tue Jun 20 00:14:40 PDT 2006


----- Original Message ----- 
From: "Jacinta Richardson"
.
.
>
> If you mix up your quotes with no clear reason (that is sometimes you use
single
> and other times double for literal data) then the person reading your code
will
> just go nuts.
>

I reckon that I mix them up "with no clear reason" ... and I also reckon
that most others do, too .... but I'm not sure that my reckoning is correct
:-)

I often do:
$x = 'Hello World';
or
@stats = stat 'some.file';

but then I *always*:
print "Hello World";

Does *anyone* ever:
print 'Hello World';

??

Is there a "clear reason" for using single quotes in the assignment and the
stat(), but double quotes in the print() ?

Anyway ... my basic thinking is that you should use single quotes unless
double quotes are needed .... or unless there's some convention that
dictates the use of double quotes .... or unless you inadvertently use
double quotes in a moment of distraction :-)

Cheers,
Rob



More information about the Melbourne-pm mailing list