in reply to decimal placement

Why are you all using double quotes in your printf formats? You aren't using any interpolation, so you should use single quotes instead (it's faster because it dosen't have to check for interpolations)

Replies are listed 'Best First'.
Re (tilly) 2: decimal placement
by tilly (Archbishop) on Mar 26, 2001 at 01:58 UTC
    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.

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

              - tye (but my friends call me "Tye")
      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.