einhverfr has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to add fully declarative mappings between database functions and classes (I am also using Moo for declarative definition of properties).
I would like to create a function has_dbmethod() which would have a similar syntax to has(), but would automatically generate wrapper functions for database functions.
Now obviously I can't use __PACKAGE__ because I need it to be in the subclass's package, not the parent. So how can I detect the namespace of the subclass, at runtime, which calls this function?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to programmatically determine package where a sub was called
by kcott (Archbishop) on Nov 06, 2013 at 06:42 UTC | |
Re: How to programmatically determine package where a sub was called
by tobyink (Canon) on Nov 06, 2013 at 23:37 UTC |
Back to
Seekers of Perl Wisdom