Lists
Learn how to use lists in Perl.
We'll cover the following...
Empty list
When used on the right-hand side of an assignment, the () construct represents
an empty list. In scalar context, this evaluates to undef. In list context, it’s an empty list. When used on the left-hand side of an assignment, the () construct imposes list context, hence this
Perl
my $count = () = get_clown_hats();say $count;sub get_clown_hats {return ("flat cap", "bowler hat", "derby hat", "bolo hat", "gat");}
Because of the right ...
Ask