Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: wantarray documentation in 5.8.7

by simonm (Vicar)
on Jul 26, 2005 at 17:31 UTC ( #478303=note: print w/replies, xml ) Need Help??

in reply to Re^2: wantarray documentation in 5.8.7
in thread wantarray documentation in 5.8.7

Now the actual purpose of this thread is to find a form of words that distinguishes these cases, so the docs can be patched to avoid the current inaccuracy which suggests that wantarray is never meaningful at the top level.

I would guess, although I have not tested it, that the talk about the "top level" also applies to code entered via -e, even though that's not "a file."

The distinction seems to be about the "main" source code, so I'd say: "wantarray()'s result is unspecified in the top level of a source file a program's main source code, in a BEGIN , CHECK , INIT or END block, or in a DESTROY method."

Perhaps "main source code" isn't the right phrase, but it's closer to the point than "a source file."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://478303]
[james28909]: how can i write a while loop on one line (in a script) something like print "this\n" && print "that" && <DATA> && print the other\n" && next if /this matches/ while <DATA>?
[james28909]: i have tried with && and and and have tried to rearrange the functions as well to no avail
[shmem]: use parens to group expressions
[shmem]: you can't use next in a statement modifier
[shmem]: next requires a BLOCK

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-05-20 18:42 GMT
Find Nodes?
    Voting Booth?