> D. Bolliger wrote: >> Mug am Mittwoch, 25. Oktober 2006 13:12: >> >>> I don't know if that anyway I can know what should I pass back >>> from right hand side to left hand side, like : >>> >>> my $x = qw/a b c d e / ; # so I have $x = 5 >> >> The list on the right hand side is evaluated in scalar context, and that >> delivers the number of entries in the list. > > No it doesn't: > > $ perl -le' $x = qw/ a b c d e /; print $x' > e
Why? That doesn't make sense to me. 1) perl -le '($x) = qw/a b c d e/; print $x' a 2) perl -le '$x = qw/a b c d e/; print $x' e 3) perl -le '$x = ( qw/a b c d e/ ); print $x' e 4) perl -le '@a = qw/a b c d e/; $x = @a; print $x' 5 Why are (2) and (4) different? Or better what is (2) doing? Why doesn't (3) work? - B -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>