You can trap any of the Perl signals and send then you a custom routine
like:

# trap warning and die messages and exit
$SIG{'__WARN__'} = \&trap;
$SIG{'__DIE__'} = \&trap;

sub trap {
 my ($message) = @_;
 print "\nERROR: $message\n";
 exit (1);
}

Trevor Joerges

----- Original Message ----- 
From: "Ignacz, Alex" <[EMAIL PROTECTED]>
To: "Perl-Win32-Users" <[EMAIL PROTECTED]>
Sent: Thursday, September 11, 2003 12:56 PM
Subject: Is there something like $SIG{__PRINT__} = sub {


> Hi there, I'm trying to create a generalized
>
> "catch all print and stick some info in front of each line"
>
> routine
>
> and I was wondering if there is something like the __WARN__ signal trap?
>
> Or if there is a way to mimic this with a subroutine.
>
> Thanks in advance.
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to