Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: wantarray propagation?

by John M. Dlugosz (Monsignor)
on May 20, 2011 at 19:58 UTC ( #905962=note: print w/ replies, xml ) Need Help??


in reply to wantarray propagation?

Indeed. You can use scalar foo(...) to force foo to be called in scalar context. I think using the function on a line by itself, without using the return value, will give void context. The reason it is not the case in your example is because test() is the last line in the function test2, and is an implicit return statement. You are actually saying return test() which propagates test2's context. Write test(); return; instead.

Comment on Re: wantarray propagation?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2016-04-30 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (441 votes). Check out past polls.