use strict; use warnings; use Benchmark qw( cmpthese ); my $passes = 100_000; my $tests = -10; sub with { use warnings; my $i = 0; $i = $i + 1 # Undefined check for 0..$passes; 1; } sub without { no warnings; my $i = 0; $i = $i + 1 # No undefined check for 0..$passes; 1; } cmpthese($tests, { with => \&with, without => \&without, });