in reply to Timing a Subroutine with Parameters

I think you'll find the error right about here ...
$t = timeit(1, \&stuff(1000000)); ^
You're trying to execute a reference that points to the return of the stuff sub. Instead you probably want something like this
$t = timeit(1, sub { stuff(1000000) });
If you want to time functions within programs you may also want to check out the Devel::DProf module.
HTH

_________
broquaint