http://qs321.pair.com?node_id=601113


in reply to Re^3: trapping -w warnings
in thread trapping -w warnings

On second thought, I don't think I needed that eval block. This works fine too.
use strict; use warnings; { local $SIG{__WARN__} = sub { my @warnings = @_; foreach my $warning (@warnings) { warn "in handleEncoding, got a warning: $warning\n"; } }; warn "blee"; warn "blah"; warn "bloo"; }