use Data::Dumper;
my @A = qw(1 2 3);
my @B = qw(A B C D);
print Dumper(@A or @B);
In example C, or does return a scalar. You just don't do anything with the scalar. print @list or die is not parsed as print(@list or die); it's parsed as print(@list) or die. Therefore, print only sees the list; it doesn't see the result of the or operator.
Update: meh... the right hand side of or can result in or returning a list:
use Data::Dumper;
my @A = qw();
my @B = qw(A B C D);
print Dumper(@A or @B);
The left hand side cannot.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
|