in reply to Re: Find the name of a CODEref
in thread Find the name of a CODEref
It would be better to simply return undef than die if it's not a code ref wouldn't it?
Well that's largely dependent on the coding conventions for you/your project. But in general I'd say No, it makes more sense to die, because it likely represents a programming error, which you'd like to catch during development. Put another way: it's probably better to ensure a priori that only code refs are being passed in, than to have to try to handle errors resulting from passing a non-code-ref.
|
|---|