Or, if one really wants to do everything in one line, and the $item variable is not used for anything else:
push @{ $self->{select} }, $self->grid($x, $y) || ();
Update: I see Roy Johnson already posted essentially the same code at Re: Scoping question, though he opted to use or with parentheses instead of ||, as I used.
In reply to Re^2: Scoping question
by revdiablo
in thread Scoping question
by Dr. Mu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |