But the reverse call isn't one level removed. The call
to reverse is the first argument and it is being evaluated
in scalar context. In your example you have only one case of using a
literal list in the foo_bar() call, which gives you a prototype
error. In all other cases you are calling foo_bar() with a single
expression that will be evaluated according to the context of the first (or
only in your case) prototype.
| [reply] [d/l] |
| [reply] [d/l] [select] |
That propogation is no more suprising than what you get if
you had used an explicit scalar coercion in your unprototyped
version, foo(scalar bar()).
| [reply] [d/l] |
Re your update.
scalar(bar()) calls bar in scalar context, thus bar's
return() is in scalar context and is equivelant to
return scalar(bam()), which means bam's return is
equivelant to return scalar(baz(),zab()), which means
each of baz() and zab() are called in scalar context and the result
of the last one is returned.
| [reply] [d/l] [select] |