use Benchmark; my $code = ''; print "Enter number of code runs:\n"; my $runs = ; chomp ($runs); print "Inline or load up code(1|2)?\n"; my $inline = ; chomp($inline); if($inline == 1) { $/ = "#END"; print "Enter code block (end with #END):\n"; $code = ; chomp($code); print "\n...Testing...\n"; timethis($runs, $code); } else { my $file; my $func; print "Give me the file name: \n"; $file = ; chomp($file); $code = `cat $file`; eval($code); die $@ if $@; if($code=~m/sub\s+(\w+)/) { $func = $1; } no strict 'refs'; print "\n...Testing...\n"; timethis($runs, &$func); }