Perl-Sensitive Sunglasses | |
PerlMonks |
Re: if else and not reachable coding styleby fergal (Chaplain) |
on Mar 08, 2006 at 22:22 UTC ( [id://535275]=note: print w/replies, xml ) | Need Help?? |
I'm a little unclear on what you're trying to achieve. Are you using a sub because this code will be called from multiple places or are you just using it because COND and the return values are too messy for a ternary? If the latter then you might try which has the advantage of keeping the logic close to where it's used and not defining a once off sub. Either way, the second construction with the die is kinda pointless as the die can never be reached.
In Section
Meditations
|
|