In the general case I would prefer an exception to be thrown since I find that leads to better code (for some definition of better :-)
The only situation where I would consider undef to be more appropriate is if the module would normally be used in a context where the constructor would be expected to fail - in which case "failure" isn't "exceptional" and might be clearer presented as normal control flow.
As ever YMMV :-)
In reply to Re: Should a constructor ever return undef?
by adrianh
in thread Should a constructor ever return undef?
by tall_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |