in reply to Catch messages to STDERR

If I understand what you're doing, this is a neat idea. You can trap errors your way even though the author of the original module trapped them thier way. Perl is just cool...

The following code catches all print operations on the STDERR file handle.

package ErrorTrapper;

sub TIEHANDLE{
    my ($class, $file) = @_;
    bless [] , $class;
}

sub PRINT{
    my ($self, @msg) = @_;
    die "@msg\n";
}

package main;

tie *STDERR, "ErrorTrapper";

print "Testing...\n\n";
print STDERR "Something went wrong!\n";
print "Shouldn't see this";
Cheers,

John