use strict; use warnings; use Benchmark qw(cmpthese); use CGI qw(:standard); my $q = new CGI; cmpthese (-3, { method => sub { $q->header; }, direct => sub { header; } }); ### RESULTS #### Rate direct method direct 14483/s -- -4% method 15106/s 4% --