use Benchmark qw(cmpthese); cmpthese(10000000, { single => sub {$foo = 'http://www.yoursite.com'}, double => sub {$foo = "http://www.yoursite.com"}, });