We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Generally, yes, given an operation that might fail, you'd like to catch and die on all errors. But there are cases where you maybe want to see if there's failure, but do nothing about it if there is. For example, in the generation of the perlmonk maps, I query a remote server for the cloud images. If the server doesn't respond, I simply ignore it and go on since the maps can be generated without it. On the other hand, if the user list from PM isn't available, then making the maps would be pointless, and I'd want to die there. EG:
So, IMO, it's nearly always better to explicitly state the die condition than to group them into one. While 90% of the time you may not have to worry about special cases, if you find the need to , you'll have to do a lot of code modification in order to get the special case to work.
-----------------------------------------------------
In reply to Re: use Fatal;
by Masem
|
|