http://www.perlmonks.org?node_id=171080


in reply to @_ still mystifies me

Disappointments:
# Unfortunate scalar conversion my @foo = @_ || @bar; # Unfortunate error, not DWIM-compatible my @foo = @_; @foo ||= @bar;
Although there are many good solutions posted here, how about a bad one?
my @bar = qw[ dog cat frog ]; sub foo { my @foo = grep{length}(@_, (!@_ && @bar)); print join(',', @foo),"\n"; }
Hey, it works, but it's quite brittle. If you even think about changing the order of the parameters, you're into SCALAR land.