note
Anonymous Monk
I have the book Learning Perl in it there's a section called "Using Scalar-Producing Expressions in List Context" then it goes on to say "Going this direction is straightforward: if an expression doesn't normally have a list value, the scalar value is automatically promoted to make a one-element list:
<code>@fred = 6 * 7; #gets the one-element list (42)
@barney = "hello" . '' . "world";</code>
In the first example, the array @fred on the left hand side of the operator = makes it a list context, did i got it right? In the second example, "hello" . '' . "world; alone is a scalar expression? Is the array @barney on the left hand side of the operator making it into list context like the first example?
11119539
11119547
7