![]() |
|
Perl Monk, Perl Meditation | |
PerlMonks |
Re: need an explanationby choroba (Bishop) |
on Sep 22, 2013 at 21:55 UTC ( #1055203=note: print w/replies, xml ) | Need Help?? |
The first line is equivalent to
qw just "quotes words". The second line is usually written as
or, for more clarity,
Perl is sensitive to context. By assigning to a scalar value, you impose the scalar context on the right hand side of the assignment. Arrays return their size (number of elements) in scalar context. Using = () = here has no effect and is only confusing. Update: It is usually used to force list context, for example
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
In Section
Seekers of Perl Wisdom
|
|