Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
this
> "If more than one variable is listed, the list must be placed in parentheses" means: If VARLIST is $x,$y,$z you must write my ($x,$y,$z) The alternative my $x,$y,$z would only declare $x because of precedence, like (my $x),$y,$z Hence an alternative to what we want is my $x,my $y,my $z But since we need a list assignment on the LHS, we still need to put it all into parens (my $x,my $y,my $z) = split ... because this my $x,my $y,my $z = split ... would only assign to $z because of precedence°, like (my $x),(my $y),(my $z = split ...) HTH! :)
Cheers Rolf
Erratas/declare/assign to/ choroba++
UPDATES°) Even worse, it would only be a scalar assignment to $z, i.e. the number of possible splits.
In reply to Re^3: my within brackets
by LanX
|
|