"Jonathan Worthington" <[EMAIL PROTECTED]> wrote:
Just went and looked at what $? holds in Perl 5 and, well, it holds the POSIX value. And the lower 8 bits actually can contain something useful (the signal that terminated the program and whether it core dumped). So my idea would have thrown away potentially useful info. That'd suck."jerry gay" <[EMAIL PROTECTED]> wrote:Sorry, I wasn't clear in what I wrote. I was suggesting a 4th option - always return the exit code so the user can use it right away, as in we >> 8 it on UNIX platforms, leave it as is on Win32, etc. So if the exit code is 1, then Ix contains 1. No matter which platform you're on. User code has to do no shifts.if i recall correctly, the options here are: 1) unix-like return value from spawnw everywhere, 2) return platform-specific value, or 3) return some object-like thingy.i don't like option 1, as i believe spawnw should return something platform-specific. an object-like thingy (option 3) might be nice, and is definitely shiny, but it doesn't exist, and requires more specification.
I still think consistent is important, not something platform specific. So here's my patch again, with the comments cleared up to say why we left shift by 8. I think it's the right thing to do.
All spawnw.t passes on Win32 with this patch. Thanks,Jonathan
spawnwargs2.diff
Description: Binary data