Which produces:my $x; my @array; @array = qw( a b c); ($x) = qw( a b c); print $x . "\n"; $x = qw( a b c); print $x . "\n";
In this assignment: ($x) = qw( a b c); In my mind we have list to list. The list on the left only has one slot so the other two values are lost. Can some please explain what is going on here: $x = qw( a b c); and why does "c" get assigned to $x Many thanks for your kind assistance. Best KDC:\dev\learningPerl>perl ex3c.pl a c
In reply to scalar vs list context by kevind0718
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |