in reply to Re^3: diagnostics, STDERR, and codepage conversions (open)
in thread diagnostics, STDERR, and codepage conversions
Ok, much more clear now, thanks. Just FYI - the reason why I didn't believe it is because I learned that idiom here ;-) e.g., an article by our own merlyn. Ok, that's not specifically here... but it's a site I only learned about from perlmonks. And the author is rumoured to be reasonably proficient... :-> (Ok, appeal to authority - he could be wrong about some stuff, even in his specialty.) Then, [id://3989;BIT=local *STDERR;BIS=%3B] shows ikegami using it without comment on style (perhaps you just missed them at the time). So I plead educated ignorance - the masters were doing it, so I thought it was a good idea ;-)
Just to continue with the thread drift (though I still would like someone to answer the original questions if they have any help), I'm wondering why they suck. As in, what way? Is it an accidental feature that could be removed from 5.10 or something?
And I found (remembered) another way to kill the messages without redirecting, which is better since it will be much more specific: set the __WARN__ handler to ignore the warning, and that will keep the diagnostics from being hit (since it's a __WARN__ handler, too):
And now I don't need to redirect, but I'm still interested in it.my $oldwarn = $SIG{__WARN__}; local $SIG{__WARN__} = sub { my ($msg) = @_; if ($msg =~ /utf8_heavy/) { # do nothing } elsif ($oldwarn) { goto &$oldwarn if $oldwarn; } else { warn @_; } };
|
|---|