Tom Allison am Donnerstag, 23. November 2006 16:13:
[snipped some code]
> I get a STDERR warning printed out everytime this has a duplicate key
> violation...
>
> Any idea why eval{} doesn't suppress this?
Hi Tom
It'd be a bad idea... eval BLOCK adds the ability to catch runtime errors and
modify the default reaction to a die. It is not here to hide any problems of
code.
You can suppress the output of warnings at a certain place by f.ex:
#!/usr/bin/perl
use strict; use warnings;
warn "Test1\n";
{
local $SIG{__WARN__}=sub {}; # <<<<
warn "Test2\n";
}
warn "Test3\n";
__END__
output:
Test1
Test3
Dani [not part of the output...]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>