in reply to Suppress STDOUT of a called program

Running a program in the background doesn't suppress STDOUT.

If you just want to suppress the output and not do anything with it you can redirect it to /dev/null:

system("/some/program >/dev/null");
If you want to capture its output to process it, the easiest way is to use `` quotes:
my $output = `/some/program`;

If your program has a lot of output that is better captured as it arrives you can use piped open:

open(my $handle, "/some/program|") or die; while (<$handle>) { # do stuff with a line }

See also perlopentut and perlipc.

Replies are listed 'Best First'.
Re^2: Suppress STDOUT of a called program
by jcoaps (Initiate) on May 16, 2007 at 23:01 UTC
    That was too easy...next time I'll ask a harder question. For anybody else who has the same question as me...NUL is the windows equivalent of /dev/null.

      File::Spec->devnull() is the cross-platform way to get /dev/null.