in reply to Re: Redirecting STDOUT
in thread Redirecting STDOUT

I believe that won't work, based on some tests. Localizing *STDOUT breaks the magic that ensures that ensures that the STDOUT handle always has fd 1, and the fd is the only thing that matters when spawning a child. Something similar that should work is:
{ local *FOO; open FOO, ">&STDOUT"; # fileno(FOO) = dup(1) open STDOUT, ">/dev/null"; # dup2(open(), 1) system @command; open STDOUT, ">&FOO"; # dup2(fileno(FOO), 1) }

    -- Chip Salzenberg, Free-Floating Agent of Chaos