Temporarily redirecting STDOUT

From: Fil (fil_at_nospam.thanks)
Date: 09/05/04


Date: Sun, 05 Sep 2004 22:43:55 +0200

Hi,

I'm writing some Perl (5.8.2) routines on Windows 2000. One of these
routines calls RCS functions like this:

$command = "rcs -x${rcssfx} -l $rcsname";
$rc = system($command);

I'm logging and printing my own error diagnostics, so I'm a little annoyed
that RCS prints to screen what it's doing. I'd like to redirect STDOUT
just for this command.

I understand that I can use open2 or open3 and collect separately the
STDOUT, STDERR and the return code and solve the problem. I'm really
interested here in learning to redirect STDOUT and of course recover it
afterwards. On Unix I'd redirect it to /dev/null... is there anything like
it for Perl on Windows?

Thanks in advance!

Fil



Relevant Pages

  • Re: GUI and Rapid Application Development?
    ... Most simple applications that I dealt with did not need the use of API ... I imagine Perl is faster, ... my Perl scripts are more compact ... Chirag> in Windows that could run on Windows 98 through 2003. ...
    (comp.os.linux.misc)
  • Re: ping Purl Gurl? Beginner Level Perl
    ... Purl Gurl wrote: ... If you are to learn Perl, ... Windows machines is good motivation for using Win. ...
    (alt.usage.english)
  • Re: My Regexp XML Parser -> Structured Perl Data, Cut & Paste Version, No Modules (Vol I)
    ... On Windows NT and later, subprocesses are now started via ``cmd /x/d/c'' ... Perl for ISAPI would sometimes close a filehandle twice. ...
    (comp.lang.perl.misc)
  • Re: Unix commands
    ... ==> writing the program in Perl, ... ==> program that had to be ported to Windows. ... After installing a Unix toolkit the script ... And every other common Unix tool. ...
    (comp.lang.perl.misc)
  • Re: Unix commands
    ... I don't recall ever writing a program that needed to trawl through ... All the Perl programs ... I'm not going to worry whether my tool is going to be run on Windows. ... // Actually many times I've ported my programs and tools to Unix too! ...
    (comp.lang.perl.misc)