sub foo { my $x = $_[0] eq 'whatever' ? $_[1] : $_[2]; ... }