We don't bite newbies here... much PerlMonks

### Re^9: Not understanding 2 sentences in perldoc (updated)

by AnomalousMonk (Bishop)
 on Jul 30, 2020 at 01:16 UTC Need Help??

```c:\@Work\Perl\monks>perl -wMstrict -le
"my (\$x, \$y, \$z);
;;
(\$x, \$y, \$z) = qw( 1 2 3 );
print qq{\$x, \$y, \$z};
;;
((\$x, \$y, \$z) = qw( 1 2 3 )) = qw( a b c );
print qq{\$x, \$y, \$z};
;;
(((\$x, \$y, \$z) = qw( 1 2 3 )) = qw( a b c )) = qw(foo bar baz);
print qq{\$x, \$y, \$z};
"
1, 2, 3
a, b, c
foo, bar, baz
The expression  (\$x, \$y, \$z) = ... evaluates to a list of assignable values, i.e., lvalues.
The expression  (\$x, \$y, \$z) = RHS evaluates to the list of assignable values, i.e., lvalues, \$x, \$y, \$z.

And likewise with

```c:\@Work\Perl\monks>perl -wMstrict -le
"my (\$x, \$y, \$z) = qw( 1 2 3 );
print qq{\$x, \$y, \$z};
;;
(my (\$u, \$v, \$w) = qw( 1 2 3 )) = qw( a b c );
print qq{\$u, \$v, \$w};
;;
((my (\$r, \$s, \$t) = qw( 1 2 3 )) = qw( a b c )) = qw(foo bar baz);
print qq{\$r, \$s, \$t};
"
1, 2, 3
a, b, c
foo, bar, baz

Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^10: Not understanding 2 sentences in perldoc (updated)
by zapdos (Sexton) on Jul 30, 2020 at 02:40 UTC
Arigato gozaimasu ^^

Create A New User
Node Status?
node history
Node Type: note [id://11120038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2020-10-20 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
My favourite web site is:

Results (208 votes). Check out past polls.

Notices?