my @x; sub foo :lvalue { my ($cond, $i) = @_; my $lvalue; ($cond) ? $x[$i] : $x[0]; }