use strict; use Benchmark; timethese(1500000, { 'unpack' => 'unpack "H*", "abc"', 'sprintf' => 'sprintf "%x%x%x",ord("a"),ord("b"),ord("c")' } );