{
local $^W = 0;
call_library_that_warns();
}
Rather than disabling all warnings as local $^W = 0; does, it may be prudent to disable only the specific annoying warnings expected to be generated by the library in question. Consider
versusc:\@Work\Perl>perl -wMstrict -le "sub foo {} my $u; ;; print 'before block'; { print 'in block'; sub foo {} print $u; my $r = substr 'x', 5, 5; } print 'still running after block'; " Subroutine foo redefined at -e line 1. before block in block Use of uninitialized value $u in print at -e line 1. substr outside of string at -e line 1. still running after block
(Note that some warnings occur at compile-time, some at run-time.) See perllexwarn. (Update: With some version of Perl after 5.14.4, the content of perllexwarn was integrated into warnings; the former doc file is now a stub.)c:\@Work\Perl>perl -wMstrict -le "sub foo {} my $u; ;; print 'before block'; { print 'in block'; no warnings qw(uninitialized substr); sub foo {} print $u; my $r = substr 'x', 5, 5; } print 'still running after block'; " Subroutine foo redefined at -e line 1. before block in block still running after block
Give a man a fish: <%-{-{-{-<
In reply to Re^4: Help integrating R code into Perl code
by AnomalousMonk
in thread Help integrating R code into Perl code
by kantica
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |