Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It seems that what you wrote is correct. A possible source of confusion is that some part of the context is partially determined at compile time, and partially at run time. In particular, the void context of all lines except the last inside a subroutine is determined at compile time, and the "Useless use of ... in void context" warnings from use warnings or -w are based on that:
At run time, the context of the last expression or the return value is evaluated in the same context as the the whole sub, and that context information recursively flows inwards into any subs. So if you have
then the context of g is that of f, determined dynamically at run time. In reply to Re: Context propagation into subs and evals
by moritz
|
|