I usually use the third form. The else in your examples is superfluous, as is the die statement. However - if the conditionals become more complicated over time, it would be a good idea to have a default 'die' to catch any errors I made in nesting or in my logic.
It seems to me that perl would optimize away the 'else' in your first example so that this sub became equivalent to the third.
In reply to Re: if else and not reachable coding style
by spiritway
in thread if else and not reachable coding style
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |