Working on a largish project, I have a ton of info to STDERR for watching what's up while the program is running.
I would have some errors and then it was tough to find them back in the code- I had a mountain of info on my error log. (using tail -f has been glorious)
For example, I know my sub will need scalar $a to hold a digit, if it doesn't- then I would normally output an error to STDERR, I felt that die was more holy, only for things that the system or perl would recognize as a real 'you are deadw, monkey' error.
lately, I realized that I should use die() a lot..?
1) Does this seem like it would help debugging, use die *whenever* something happens that should not happen? Is this a no brainer? What do other people do?
2) I've heard here and there that subs and scripts should ideally output nothing unless there's an error, is there any controversy to this amongst more experiences coders? Or is this basic mattured wisdom?
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |