Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: question 1st - undefined behaviour

by ikegami (Pope)
on Sep 24, 2013 at 18:56 UTC ( #1055525=note: print w/ replies, xml ) Need Help??


in reply to question 1st - undefined behaviour

1)$x - return's copy of object $x and then return it's value in numeric context.

While scalar, list and void context affect what an operator returns, that's not the case for numeric, string and boolean context. They're not actually contexts as they don't affect what an operator returns.

For example, addition imposes a scalar context on its operands, but those operands could just as easily return strings instead of numbers. The addition operator itself will convert the scalars to numbers.

$x places that scalar on the stack. Not a copy of it.


Comment on Re: question 1st - undefined behaviour
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-08-31 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls