use strict; use warnings; use Benchmark qw( cmpthese ); use constant DEBUG => 0; my $b = 100; cmpthese -10, { constant => sub { my $a = 10 * $b; $a = 10 * $b if DEBUG; }, noconstant => sub { my $a = 10 * $b; }, };