Thanks for all the great insight. I think I going to simply redirect the output as Mike suggested.<br> <br> Thanks again,<br> <br> Richard<br><br><b><i>Jonathan Rockway <jon@jrock.us></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> It might be more concise/readable to do this:<br><br>if(fork()){<br> close *STDERR;<br> `ls /nonexistent`; # or whatever<br>}<br>else {<br> print {*STDERR} "stderr still works here\n";<br>}<br>wait();<br>print {*STDERR} "and here\n"<br><br>This, BTW, is inconsistent with the description in perldoc ("fds are <br>shared", it says).<br><br>Regards,<br>Jonathan Rockway<br><br>Jess Balint wrote:<br>> Richard,<br>><br>> Yet another way is to dup the stderr onto a new fd and then run your<br>> command. You can restore it afterwards. The following example dups stderr<br>> onto olderr, then opens stderr onto /dev/null. The command "ls /xxx"
is run<br>> and no error output is displayed. The stderr fd is then restored by duping<br>> olderr back onto stderr and the command "ls /yyy" is run with the error<br>> output visible. (It's not the coolest one-liner ;)<br>><br>> perl -e'open(OLDERR, ">&STDERR");open(STDERR, ">/dev/null");system("ls<br>> /xxx");close(STDERR);open(STDERR, ">&OLDERR");system("ls /yyy");'<br>><br>> ________________________________________<br>> Hello All,<br>><br>> Is there a way to execute a system command with out the console printing an<br>> error message? I wan't to do system("play soundfile.wav") but I do not want<br>> the error message to print out if the file cannot be played. <br>><br>> Any help would be greatly appreciated.<br>><br>> Thanks in advance,<br>><br>> Richard<br>><br>><br>> Your beliefs become your thoughts. Your thoughts become your words. Your<br>> words become your actions. Your
actions become your habits. Your habits<br>> become your values. Your values become your destiny. -- Mahatma Gandhi<br>><br>> _______________________________________________<br>> Chicago-talk mailing list<br>> Chicago-talk@pm.org<br>> http://mail.pm.org/mailman/listinfo/chicago-talk<br>> <br><br>_______________________________________________<br>Chicago-talk mailing list<br>Chicago-talk@pm.org<br>http://mail.pm.org/mailman/listinfo/chicago-talk<br></blockquote><br><BR><BR>Your beliefs become your thoughts. Your thoughts become your words. Your words become your actions. Your actions become your habits. Your habits become your values. Your values become your destiny. -- Mahatma Gandhi