#! perl -l use strict; use warnings; sub list0 { qw() } sub list1 { qw(foo bar); } sub list2 { qw(baz zap) } sub do_it { list1() || list2(); } sub do_it_right { my @x = list1(); @x = list2() unless @x; @x; } sub do_it2 { list0() || list2(); } print join ':', do_it(); print join ':', do_it_right(); print join ':', do_it2();