54

Variables
Lists as L-Values

  • You can use lists on the left-hand side of an assignment "=" operator

      ( $first, $last ) = ( "John", "Moreland" );

  • Perl uses "greedy" assignment for L-Values. Here, $d is left untouched

      ( $a, $b, @c, $d ) = ( "a", "b", "c", "d", "e" );

  • But, here, "e" is simply not assigned

      ( $a, $b, $c, $d ) = ( "a", "b", "c", "d", "e" );