in reply to if else and not reachable coding style

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

$value = do { if (COND) { 1; } else { 2; } };
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.