Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppressing error messages

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
0
0
US
Although I cannot find it, I thought there was a directive for turning off error messages. How do I turn off error messages from perl calls that I expect? TIA.
 
Redirect your STDERR to the bit bucket (or don't make errors ;-)


Yours,


fish

"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
Try this:

Code:
open STDERR, "> /dev/null" || die "Cant redirect standard error: $!";

=================
Bad Company Music
=================
 
Thanks. I didn't think that would work with Windows but it does.
 
I think that some ports of perl fake /dev/null. In general, I think you should open the appropriate bit-bucket for your platform, which would be [tt]NUL:[/tt] under windoze.

On the other hand, if it works...

Yours,


fish


"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilkes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top