in reply to How do I redirect outut from system () to a file and also to screen
The system() built-in doesn't return the output of the command. Whatever command runs shares the same standard output and standard error as the perl process. Are you sure you aren't seeing the output from "cleartool describe" on the screen?
Besides that, the tee is only going to work from the Perl program. The system() call won't know anything about it. You can collect the output from the command with the backticks or qx// operator (they're the same thing), then print it to wherever you want to put it.
The normal advice about collecting standard error involves some unix shell stuff, and I'm not sure how that works on Windows so I'll have to defer to someone else about that. I tend to like IPC::Open3, but I've heard mumblings about people who have had problems with that on Windows.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I redirect outut from system () to a file and also to screen
by Anonymous Monk on May 24, 2005 at 23:40 UTC | |
by ivancho (Hermit) on May 25, 2005 at 01:23 UTC |