Think about Loose Coupling | |
PerlMonks |
Re: Automating dispatch tablesby demerphq (Chancellor) |
on Apr 16, 2004 at 14:19 UTC ( [id://345772]=note: print w/replies, xml ) | Need Help?? |
Actually Chip recently pointed out on p5p that the second one is not the right way to handle this. In reality you are much better off avoiding can() and doing:
This is because for all kinds of reasons can() is not 100% safe. For instance if the method needs to be autoloaded can() will return false, but calling the sub wont. IMO the first one is also not the greatest way to write that.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
In Section
Meditations
|
|