Lists, Arrays, and Hashes
List Assignment
List assignment copies several values into several scalar variables in order.
List Assignment
list_assignment.pl
use strict;
use warnings;
my $middle = ;
my ($first, $second, $third) = ("red", $middle, "blue");
my $summary = "$first,$second,$third";
print "first=$first\n";
print "second=$second\n";
print "summary=$summary\n";
use strict;
use warnings;
my $middle = ;
my ($first, $second, $third) = ("red", $middle, "blue");
my $summary = "$first,$second,$third";
print "first=$first\n";
print "second=$second\n";
print "summary=$summary\n";
use strict;
use warnings;
my $middle = ;
my ($first, $second, $third) = ("red", $middle, "blue");
my $summary = "$first,$second,$third";
print "first=$first\n";
print "second=$second\n";
print "summary=$summary\n";
list assignment
List assignment places each value from the right side into the matching variable on the left side.