use Benchmark qw(:all) ; my $value = 'FALSE'; my $count = 10_000_000; cmpthese($count, { 'regex' => sub { $value =~ /^true$/i }, 'eq' => sub { lc $value eq "true" }, });