in reply to Reference sub name

In addition to the already suggested solution involving caller, did you consider Log::Log4Perl, which (depending on your actual logging needs) might already solve automatically what you are looking for.
-- 
Ronald Fischer <ynnor@mm.st>