Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Please explain 'list' assignment.by friedo (Prior) |
on Nov 03, 2006 at 19:10 UTC ( [id://582141]=note: print w/replies, xml ) | Need Help?? |
Because list assignments are parallel. A list of three items on the left expects three items on the right. Since there's only one, $var2 and $var3 remain undefined. You can do what you want with:
Update: Oops - I read your question slightly wrong. To assign the same value three times, use or (thanks Sidhekin)
In Section
Seekers of Perl Wisdom
|
|