Well you could also write
sub sg { (COND) && return 1; return 2; }
But for clarity I would definitely prefer your first suggestion (especially if, as you say, things are a bit more complicated).
In reply to Re: if else and not reachable coding style
by tirwhan
in thread if else and not reachable coding style
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |