Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

by thelenm (Vicar)
on Jun 27, 2002 at 16:46 UTC ( #177759=note: print w/ replies, xml ) Need Help??


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

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}


Comment on Re: Re: Re: Some suggestions on coding style - a chance to critique
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (12)
As of 2015-07-07 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls