in reply to Re^2: Help integrating R code into Perl code
in thread Help integrating R code into Perl code

A few things to try any-or-all-of:
  1. Since this is a warning from a library you didn't write, you can silence warnings from it by enclosing it in a block and turning off warnings in the dynamic scope.
    {
      local $^W = 0;
      call_library_that_warns();
    }
  2. Make a very small example that warns- perhaps running a "Hello World" R script- and post a bug report. It could be a bug in either Statistics::R or Win32API::File - but since the example would start with R, then I'd start by reporting there.
  3. If you're ambitious and have time, run that small example script in the debugger shell "perl -d Hello_World_r.pl", and try to find out more about the problem, and perhaps create a patch you can send to the appropriate party...
  • Comment on Re^3: Help integrating R code into Perl code

Replies are listed 'Best First'.
Re^4: Help integrating R code into Perl code
by AnomalousMonk (Archbishop) on Jun 19, 2016 at 22:22 UTC
    {
      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

    c:\@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
    versus
    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
    (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.)


    Give a man a fish:  <%-{-{-{-<