Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Some suggestions on coding style - a chance to critique

by emilford (Friar)
on Jun 26, 2002 at 15:03 UTC ( [id://177395]=note: print w/replies, xml ) Need Help??


in reply to Re: Some suggestions on coding style - a chance to critique
in thread Some suggestions on coding style - a chance to critique

You're right! I looked at this post and they mentioned using single quotes when no interpolation of variables is needed. They also mentioned that this is a matter of personal preference. This probably would be good practice, but in my use, I'm not sure if it makes that big a difference. I wonder how much of a time difference single quotes vs. double quotes makes? Either way, thanks for the suggestion.
  • Comment on Re: Re: Some suggestions on coding style - a chance to critique

Replies are listed 'Best First'.
Re: Re: Re: Some suggestions on coding style - a chance to critique
by thelenm (Vicar) on Jun 27, 2002 at 16:46 UTC
    Running this code:
    use Benchmark qw(cmpthese); cmpthese(10000000, { single => sub {$foo = 'http://www.yoursite.com'}, double => sub {$foo = "http://www.yoursite.com"}, });
    produces these results on my machine:
    Rate double single double 2865330/s -- -2% single 2915452/s 2% --
    So it looks like single quotes may be slightly faster, but that may be within the margin of error. I generally use single quotes unless I need interpolation of variables, but it's probably just a matter of preference.

    -- Mike

    --
    just,my${.02}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://177395]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-26 01:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found