in reply to Re: decimal placement
in thread decimal placement

My recollection - which may be wrong - is that in Perl 5 there is no real difference between single and double quotes. At compilation it figures out whether there is any interpolation.

In which case the difference between using double and single quotes is basically irrelevant. Use whichever one you find clearer.

Replies are listed 'Best First'.
(tye)Re: decimal placement
by tye (Sage) on Mar 26, 2001 at 04:36 UTC

    See this for benchmarks on exactly how little difference this type of change makes.

            - tye (but my friends call me "Tye")
Re: Re (tilly) 2: decimal placement
by Anonymous Monk on Mar 26, 2001 at 08:15 UTC
    this is false. single quotes are literal quotes meaning do not interpolate ever. double quotes allow interpolation, though in programming perl they are also listed as "literal" they are literal w/ interpolation (pg. 41, Programming Perl 2nd ed.).

    --caesium

    capitalization takes away valuable keystrokes... my doctor recommends no more than 5x10^50th keystrokes per day

      I meant, obviously, that there is no performance difference when you are not using interpolation. Of course there is a difference in what will happen if you have $foo between the quotes. Every beginner learns that fairly early. But in terms of performance the difference between 'hello' and "hello" comes entirely down to how fast Perl parses the string and figures out that there is no interpolation.