in reply to Re: mod_perl seems to have disappeared the open function
in thread mod_perl seems to have disappeared the open function

If so, I think that means the problem should be solved by using proper scoping.

{ local *STDOUT; local *STDERR; open(STDOUT, ">/dev/null") or $log->die("Unable to redirect STDOUT to dev null: $!"); open(STDERR, ">/dev/null") or $log->die("Unable to redirect STDERR to dev null: $!"); ... }

Why are you redirecting to null (slow!) rather than just closing the file handle?

{ local *STDOUT; local *STDERR; ... }

Replies are listed 'Best First'.
Re^3: mod_perl seems to have disappeared the open function
by talexb (Chancellor) on Nov 28, 2006 at 04:28 UTC
      Why are you redirecting to null (slow!) rather than just closing the file handle?

    Huh. Good question. Well, to quote a movie I saw recently, "It's complicated" (I think that was MI:3).

    I actually want to run Ghostscript within mod_perl and pipe commands to it, but unfortunately Ghostscript is quite chatty, so to keep things clean, I want to disable the output streams. I'm also thinking it might be useful to re-direct the output streams to temporary files until I get all this stuff figured out.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds