# init the app sub _ { 'compile time '.@_}; my $compile = _(1); sub foo { _(1) }; # finished compiling, so redefine sub _ sub _ { 'run time '.@_}; # run the code my $run = foo(); print " $compile - $run\n" __END__ compile time 1 - run time 1