in reply to Giving name to anonymous function

*subname = $sub_ref;. Search for glob in perldata for more details.

Replies are listed 'Best First'.
Re^2: Giving name to anonymous function
by tilly (Archbishop) on Apr 22, 2009 at 14:45 UTC
    That will give a name by which the function may be called. It will not make caller give the function a clear name. If you want the latter, SubName is your friend. You can also accomplish the same thing by having local *__ANON__ = "$package\::$function"; in your function. (SubName is clearer.)