[EMAIL PROTECTED] wrote:
On 01/04/2003 10:21:30 $Bill wrote:


$SIG{'__WARN__'} = sub {
my $msg = shift;
$msg =~ s/^(.*)\s+at\s+\S+\s+line\s+\d+/$1/;
printf STDERR "%s (%s): %s\n", __FILE__, __LINE__, $msg;
};

warn "Error";



Have you tried this ? Add a few more calls to warn and you'll see that all
warnings are reported at the same line (the one with the printf) !

You really need to process the string you are given as a parameter, because
it contains the actual file and line.

P.S. Please don't CC me, I'm on the list.

I was just reformatting the given code. I posted a better solution using caller in a followup.


-- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/


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

Reply via email to