Re: Disable warnings from specific module



snunes@xxxxxxxxx wrote:
Hi,

I'm using a module with a couple of experimental features (SOAP::Lite)
and, every time these features are used, a warning message is
outputted. I would like to know how can I simply disable these outputs
while keeping warnings for my code?

use strict;
use warnings;

use SOAP::Lite;


I would have expected this to have worked:

mark@owl:~$ cat AA.pm
package AA;

use strict;
use warnings;

sub testsub {
my $test;
print "$test\n";

}

1;
mark@owl:~$ cat testaa.pl
use strict;
use warnings;

use AA;

{
package AA;
use warnings::register;
}
no warnings q(AA);

AA::testsub();
mark@owl:~$ perl testaa.pl
Use of uninitialized value in concatenation (.) or string at AA.pm line 8.

but it doesn't surpress the warning message, although adding

use warnings::register;

to AA.pm has the desired effect.

Mark
.



Relevant Pages

  • Getopt::Std and warnings
    ... I want a warning message without having to do special coding with ... colon to give a warning message or even possibly die (Haven't ... Doesn't give any warnings. ... A secondary suprise was seeing that ARGV is reported as empty at each ...
    (perl.beginners)
  • Re: Getting warning message while running the following code
    ... The warning message is as Useless use of string in void context at ... use strict; ... use warnings; ... use Cwd 'abs_path'; ...
    (perl.beginners)
  • Re: Linux 2.6.28-rc2 i/o error on /dev/ttyUSB0
    ... But look at the attached dmesg file - there are WARNINGs still. ... Thats an unrelated and long long standing bug - the USB serial close paths ... will occasionally get a warning message is that we bother to actually trap ...
    (Linux-Kernel)
  • Disable warnings from specific module
    ... I'm using a module with a couple of experimental features ... and, every time these features are used, a warning message is ... while keeping warnings for my code? ... use strict; ...
    (comp.lang.perl.misc)
  • Re: Warning: constant expression violates subrange bounds
    ... On the internet I found a small unit to calculate CRC32 values, which I need for a small project. ... However, I'm not inclined to change the unit, so I'd like to know if there is a way to turn off the warnings for this particular unit. ... a warning message. ... But modifying the CFG file will make the compiler directive as the default settings and it will affect more than one units being compiled. ...
    (comp.lang.pascal.delphi.misc)