in reply to if else and not reachable coding style

I use one of the following three:

sub sga { if (COND) { 1; } else { 2; } } sub sgb { COND and return 1; 2; } sub sgc { COND ? 1 : 2; }

Typically I use the sga version when both 1 and 2 are complicated comands, sgb when 1 is a simple and short expression and 2 is much more complicated. This is not an absolute rule: I sometimes use sgb even with 1 being a complicated command, like

sub sgb_prime { COND and do { somecommand(); somemorecommand(); return 1; }; evenmorecommand(); verylongsequenceofcommands(); andsomemore(); 2; }

I use sgc only in the simplest cases, when both 1 and 2 are single lines.