Sequences, Sets, Bags, Functions
Groups of Items
A sequence is an ordered list of items, whose items aren't necessarily unique. Perl's arrays are sequences of a finite size:
my @sequence = qw/bar baz ban baz baz/;
A set, however, is an unordered collection of unique items. Perl provides native support for sets in the form of the keys of hashes:
my %set1 = map { $_ => undef } qw/foo bar baz/;
my %set2 = map { $_ => undef } qw/bar foo foo baz/; # Same as above
my %set3 = map { $_ =>…