Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: scalar in list context

by ikegami (Pope)
on Jan 26, 2010 at 22:41 UTC ( #819798=note: print w/ replies, xml ) Need Help??


in reply to Re: scalar in list context
in thread scalar in list context

Maybe you mean the context of the assignment?

All three of your assignments are evaluated in void context, so I think you mean "the context imposed by the assignment" onto its operands.

assignment forces the context of the LHS onto the RHS.

So what determines the context of the LHS?

The context in which both operands of an assignment are evaluated is determined by the type of assignment (scalar assignment or list assignment). Both types of assignments are represented by "=" in the code, so the type of assignment is determined by the literal code on the LHS.

Expressions in parens, arrays, hashes, local() and my() cause the creation of a list assignment. Everything else causes the creation of a scalar assignment.


Comment on Re^2: scalar in list context
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://819798]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-09-19 04:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls