use strict; use warnings; use Benchmark("cmpthese"); cmpthese(-1, { 'double' , q !eval q {$a = "this is a string \$i"}!, 'single' , q !eval q {$b = 'this is a string $i'}!, 'double no $', q !eval q {$a = "this is a string"}!, 'single no $', q !eval q {$b = 'this is a string'}!, }); __DATA__ C:\test>perl interpolation_bench.pl Rate double single double no $ single no $ double 22226/s -- -16% -17% -17% single 26331/s 18% -- -2% -2% double no $ 26733/s 20% 2% -- 0% single no $ 26733/s 20% 2% 0% -- C:\test>perl interpolation_bench.pl Rate double single double no $ single no $ double 21065/s -- -20% -21% -21% single 26331/s 25% -- -1% -2% double no $ 26714/s 27% 1% -- -0% single no $ 26756/s 27% 2% 0% -- C:\test>perl interpolation_bench.pl Rate double single single no $ double no $ double 21966/s -- -17% -18% -18% single 26551/s 21% -- -1% -1% single no $ 26733/s 22% 1% -- -1% double no $ 26947/s 23% 1% 1% -- C:\test>perl interpolation_bench.pl Rate double single single no $ double no $ double 22226/s -- -14% -16% -17% single 25960/s 17% -- -1% -3% single no $ 26331/s 18% 1% -- -2% double no $ 26733/s 20% 3% 2% -- C:\test>perl interpolation_bench.pl Rate double double no $ single single no $ double 20785/s -- -19% -21% -23% double no $ 25551/s 23% -- -3% -5% single 26211/s 26% 3% -- -3% single no $ 27019/s 30% 6% 3% --