1. Perl
  2. Syntax
  3. context
  4. here

List context

Perl has a concept called context, and the context that evaluates as a list is called the list context .

Assignment to array

Assignment to array is a list context.

my @values2 = @values;

List

Inside list is the list context.

(@values);

Anonymous array generator

Inside the anonymous array generator is the list context.

[@values];

Anonymous hash generator

Inside the anonymous hash generator is the list context.

{@values};

Please note that it is a place that is automatically expanded and difficult to notice.

Subroutine arguments

The argument of subroutine is the list context.

func (@values);

Please note that it is a place that is automatically expanded and difficult to notice.

Related Informatrion