in reply to Re^4: Not understanding 2 sentences in perldoc
in thread Not understanding 2 sentences in perldoc
The assignment my ($x, $y, $z) = qw( 1 2 3 ) happens first, i.e. those three variables are assigned the numbers 1 to 3, and this first assignment returns the lvalues, to which the values qw( a b c ) are immediately assigned. Update: In other words, the numbers are assigned to the variables, but then immediately overwritten. Since this is just some example code it doesn't make much sense here, but in theory, you could for example be assigning to tied variables where assigning to the variable has some side effect, then it would make a difference.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Not understanding 2 sentences in perldoc
by LanX (Saint) on Jul 29, 2020 at 21:35 UTC | |
by haukex (Archbishop) on Jul 30, 2020 at 18:50 UTC | |
by LanX (Saint) on Jul 30, 2020 at 20:08 UTC |
In Section
Seekers of Perl Wisdom