I'm not sure if I fully understand your problem. You are
saying that the line number reported is the same for each
call, but that's not quite true. You get two line numbers,
which is logical, because you create two subs: A::fancy
and A::auto. If you want to get the line number for each
invocation, and not for each first invocation (when the
sub is stuffed in the stash), there's a simple fix. Put the
call to