quoting philosophy

quoting philosophy

am 24.08.2007 20:11:56 von Larry

Perl gurus... What's your "philosophy" about single vs. double quotes,
where you're not using any interpolation.

i.e.

$x = 'foo';

or

$x = "foo";

I know there are weightier issues to spend time worrying about
but... :)

Re: quoting philosophy

am 24.08.2007 20:29:16 von Michele Dondi

On Fri, 24 Aug 2007 18:11:56 -0000, Larry
wrote:

>Perl gurus... What's your "philosophy" about single vs. double quotes,
>where you're not using any interpolation.

When I don't use interpolation or escapes, then I prefer single
quotes. But it still all depend on the context. In some specific
situations I use alternate delimiters both when I need interpolation
and when I don't.


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^ ..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER 256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,

Re: quoting philosophy

am 24.08.2007 23:49:02 von g_m

"Larry" > wrote ...
> Perl gurus... What's your "philosophy" about
> ... quotes

Philosophy about quotes? ...

------------------------------------------------------------ -----------
(source: -- http://www.whimsy.org.uk/quoteindex.html )
------------------------------------------------------------ -----------

Quotation, n.: The act of repeating erroneously the words of another.
The words erroneously repeated.
~ Ambrose Bierce, The Devil's Dictionary

Quotations will tell the full measure of meaning,
if you have enough of them.
~ James Murray

The art of quotation requires more delicacy in the practice than those conceive
who can see nothing more in a quotation than an extract.
~ Benjamin Disraeli

It is my belief that nearly any invented quotation,
played with confidence, stands a good chance to deceive.
~ Mark Twain, Following the Equator

I hate quotations. Tell me what you know.
~ Ralph Waldo Emerson, Journals and Miscellaneous Notebooks, May 1849

Quotes are nothing but inspiration for the uninspired.
~ Richard Kemph

The ability to quote is a serviceable substitute for wit.
~ Somerset Maugham

Have you ever observed that we pay much more attention to a wise passage
when it is quoted, than when we read it in the original author?
~ Philip G. Hamerton

The power of quotation is as dreadful a weapon
as any which the human intellect can forge.
~ John Jay Chapman

It is the little writer rather than the great writer who seems never to quote,
and the reason is that he is never really doing anything else.
~ Havelock Ellis

By necessity, by proclivity, and by delight, we all quote.
~ Ralph Waldo Emerson

~and~

There is a very fine line between "hobby" and "mental illness."
~ Dave Barry, "Things That It Took Me 50 Years to Learn"

Re: quoting philosophy

am 25.08.2007 00:26:40 von rvtol+news

Larry schreef:

> Perl gurus... What's your "philosophy" about single vs. double quotes,
> where you're not using any interpolation. i.e.
> $x = 'foo';
> or
> $x = "foo";

The compiler will quickly decide that no interpolation is possible for
"foo", so will treat it the same as 'foo'. So towards the compiler there
is no difference, until you write something like "test@example.com" or
qq{test@example.com} or

$test = < test@example.com
EOT

In practice, the '' format is a contract that no interpolation/expansion
is meant nor will happen, and the "" format means that you have to read
much more carefully.

--
Affijn, Ruud

"Gewoon is een tijger."

Re: quoting philosophy

am 25.08.2007 02:10:14 von xhoster

Larry wrote:
> Perl gurus... What's your "philosophy" about single vs. double quotes,
> where you're not using any interpolation.
>
> i.e.
>
> $x = 'foo';
>
> or
>
> $x = "foo";

If you have a string literal which is simple, what is more likely: that it
will need to be changed to include an interpolation or newline or tab at
some point in the future; or that it will need to be changed to include
a literal @ or $ or \ in the future? I find that the former is far
more common than the latter, so now I tend to use double quotes rather
than single quotes for simple string literals. The main exception is
small literal hash keys (but now I tend not to quote them at all).

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB