You can use Devel::Caller's called_as_method to determine when a particular subroutine is being called as an object/class method or as a normal subroutine.
However, in my opinion, mixing function/procedural and OO APIs in the same subroutines is almost always a bad idea :-)
In reply to Re^4: Perl module symbol import versus direct invocation
by adrianh
in thread Perl module symbol import versus direct invocation
by JayBonci
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |