Maybe the default "cmd.exe" (or whatever gets used on windows to run commands via the system() call) provides some equivalent sort of idiom, if you know how to look that up... (or maybe you can set things up so that your "do this, and do that" stuff gets run via a bash.exe shell, so you can at least redirect output to some file that you can then delete -- possibly after reading it to check for error conditions?)$command = "(do this && do that) >/dev/null 2>&1";
Apart from that, since the main problem is the fact that your perl script is running in an environment where all output to STDOUT goes to some browser client, what you have to do is to change the STDOUT file handle so that stuff written to that handle will end up somewhere else, like a scalar variable (read the output of perldoc -f open):
UPDATE: the above snippet was not tested, and on testing it, it doesn't work as intended. See ikegami's reply to me.close STDOUT; open STDOUT, '>', \$variable; system( $command ); close STDOUT; # you might want to check what got put into $variable... open STDOUT, '>-'; # reopen the real stdout
In reply to Re: How to hide system(); output.
by graff
in thread How to hide system(); output.
by bcens
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |