[OT] best way to determine existence of a function in a package

Matt S Trout dbix-class at trout.me.uk
Tue Nov 20 18:15:35 GMT 2007


On Mon, Nov 19, 2007 at 10:21:06PM +0000, Tim Sweetman wrote:
> "Whenever you want to on AUTOLOAD() its almost always better to create a 
> generic method that takes the names you would have autoloaded as an 
> extra argument rather than having methods created on the fly" - Damian 
> Conway, "Perl Best Practices"

This is absolutely true, but (1) 'almost' is not acceptable for general
solutions and (2) John was providing one specific example of overloading
can(), not the only possible reason why one might want to do so (albeit
likely the most common).

-- 
      Matt S Trout       Catalyst and DBIx::Class consulting and support -
   Technical Director      http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Christmas fun in collectable card game form -
                           http://www.shadowcat.co.uk/resources/2007_trading/


More information about the london.pm mailing list