I've read many things about STDERR and win95, many of them unusable
because they could have worked in Perl , but Win95 is a very  special
case and unless you test something, you can't write something on it,
even if you are "true"; for instance:

        "you need to redirect STDERR to a temp file in perl before
calling ``, and after it's done, read the temp file.
        Of course, the second method works for both NT and 95, but is
slower..."
or:
        "An alternative that should be OS-independent is to open STDERR
to a dup of STDOUT before doing the
        system call, i.e. prior to doing the system call do:
open(STDERR,">&STDOUT") || die;"

    I've tried all that on a Win95 OSR2 with ActiveState Perl buid 618,
testing something like  `bzz`: try this and you will see that an error
message (i.e. about "nonexisting command") is output on the MS-DOS box
(normal case) or that nothing happens at all (after you have reopen
STDERR to a file, though it works inside the perl script).

    Thanks to someone who thought of us, PERLers and others, and who
took this problem at a some lower level,
    writing an C language micro-program (as the first programmers knew
to write them at the end of last century, hmm) , producing a 10kbytes
(yes) .EXE which simply redirects STDERR on STDOUT with few side
effects, I saw, allowing any good script like PERL to catch output with
@result=`cmd`(and analyse all error messages produced by our command.com
).

    Thanks to John Navas (I don't get his mail address), I spent 1 day
looking for a solution, and some of you too, so I think it's gonna help
some of you.

    Today, it's avalaible at :
ftp.filebase72.com/pub/bfds/bfds/ERROUT.ZIP

    (of course, it's free, with GNU licensed C source, and it runs OK,
at least on a WIN95 OSR 2).

P.S.:    sorry for these oldies if you are only working with Win2k or
Unix and can simply write `cmd 2>errs` (but some of us have to join the
oldest environments to the newests).


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to