If the warning is meaningless as others have stated, you can catch all warnings by specifying a $SIG{__WARN__} handler, and prevent printing of that specific one:
use warnings; use strict; $SIG{__WARN__} = sub { my $warn = shift; if ($warn !~ /^A thread exited/){ print $warn; } }; warn "blah blah warning\n"; warn "A thread exited...\n";
Output:
blah blah warning
update: I just realized that the signal handler for warn does not appear to be re-entrant for a warn call from within the handler itself... that is, you can replace my print statement inside the handler with warn, and re-throw the actual warning:
perl -E '$SIG{__WARN__}=sub{say "handler";warn $_[0] if $_[0]!~/^A thr +ead/}; warn "blah"; warn "A thread";' handler blah at -e line 1. handler
/update
In reply to Re^3: detached threads still warn
by stevieb
in thread detached threads still warn
by pryrt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |