use Benchmark; $n = 1; timethese( 0, { 'sub' => 'flipflop($n)', 'norm' => '$n = !($n)' } ); sub flipflop { $_[0] = !($_[0]) } #### use Benchmark; $n = 1; timethese( 0, { 'sub' => '$n = flip($n)', 'norm' => '$n = !($n)' } ); sub flip { !($_[0]) }