in reply to coding a subroutine as both method and regular function

As stated above, this is a bad idea for a general interface, and if it's only because it can be confusing to the users of the API.

That said, there can be usages for this with utility functions. I'd either export a closure that calls my module with some defaults, or use Devel-Callers called_as_method to figure it out.

But again, better design it in one clear way first that solves all problems. Start with consistence, then add convenience.


Ordinary morality is for ordinary people. -- Aleister Crowley
  • Comment on Re: coding a subroutine as both method and regular function