in reply to Searching for an alternative to $0

caller, eh? OK then, how about:
$my_name = sub{($a=(caller)[0])eq'main'?$0:$a}->();

+++++++++ In theory, theory describes reality, but in reality it doesn't.