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 idiomEvery language has common patterns of expressions, which include language features and design techniques. These are known as idioms. to count the number of elements returned from an expression in list context without using a temporary variable:

Access this course and 1400+ top-rated courses and projects.