- or download this
# @array evaluated in scalar context.
my $count = @array;
- or download this
# The s/// operates on $copy.
(my $copy = $str) =~ s/\\/\\\\/g;
- or download this
# Prints $x.
print($x = $y);
- or download this
# @array evaluated in list context.
my @copy = @array;
- or download this
# @array evaluated in list context.
my ($first) = @array;
- or download this
# Only dies if f() returns an empty list.
# This does not die if f() returns a
# false scalar like zero or undef.
my ($x) = f() or die;
- or download this
my $count = () = f();
- or download this
# Prints @x.
print(@x = @y);