# f() returns three elements my $first = f(); # XXX, unless f() also allows this my ($first) = f(); # OK, uses list assignment my $first = ( f() )[0]; # OK, extracts desired scalar first my (undef, $second) = f(); # OK, uses list assignment my $second = ( f() )[1]; # OK, extracts desired scalar first # g() returns a variable number of elements my $last = g(); # XXX, unless g() also allows this my $last = ( g() )[-1]; # OK, extracts desired scalar first my $count = @all = g(); # OK, list assignment in scalar cx my $count = () = g(); # OK, list assignment in scalar cx