Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

How can I suppress 'uninitialized' warnings in a CPAN module?

by zork42 (Monk)
on Nov 17, 2013 at 15:46 UTC ( #1062996=perlquestion: print w/ replies, xml ) Need Help??
zork42 has asked for the wisdom of the Perl Monks concerning the following question:

Hi

When I run the code here basic implementation of a RTF->text converter, I get this output:
Use of uninitialized value in concatenation (.) or string at C:/Perl/s +ite/lib/RTF/Tokenizer.pm line 208, <GEN0> line 47. <-- how can I sup +press this warning? CM WEEKS/DAYS BPD HC AC Femur Length A regular fetal heart rate of ? b +eats per minute is seen. <-- expected outp +ut

How can I suppress the "uninitialized value" warning?
Why does the "no warnings 'uninitialized';" not work?

Do I need to edit "Tokenizer.pm" to suppress the warning? (Yuck!)
Or is there a better way?

I am running Active Perl 5.16.3

Thank you!

UPDATE: I forgot to say that I'm using the newest version of RTF::Tokenizer : version 1.13

UPDATE: I should have said that I am interested in a generic solution. The above is just the current annoyance ;)

Comment on How can I suppress 'uninitialized' warnings in a CPAN module?
Select or Download Code
Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by LanX (Canon) on Nov 17, 2013 at 15:53 UTC
    tl;dr Dunno if the code or module's doc or if your approach makes sense...

    But a generic solution of suppressing warnings in foreign code is manipulating signal handler in %SIG.

    I did it once and this might help here

    The routine indicated by $SIG{__WARN__} is called when +a warning message is about to be printed. The warning me +ssage is passed as the first argument. The presence of a "__WAR +N__" hook causes the ordinary printing of warnings to "STDER +R" to be suppressed. You can use this to save warnings in a var +iable, or turn warnings into fatal errors, like this: local $SIG{__WARN__} = sub { die $_[0] }; eval $proggie;

    you may want search the archives for more examples of how to use this.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by educated_foo (Vicar) on Nov 17, 2013 at 16:25 UTC
    Why does the "no warnings 'uninitialized';" not work?
    "use warnings" and "no warnings" are lexical, which means that you can't change them in modules you use. I'd remove "use warnings;" from Tokenizer.pm, or add
    BEGIN { $INC{"warnings.pm"}="blah" }
    to the beginning of your program.

    EDIT: To explain, %INC is a hash table where Perl keeps track of what modules it has already loaded. The above line tells Perl "yeah, yeah, I've already loaded "warnings.pm". "warnings.pm" does its work in warnings::import(), called when some code does "use warnings," but since you've told it that "warnings.pm" has already been read, and warnings::import() is undefined, Perl won't call it, and hence won't create the annoyance.

Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by toolic (Chancellor) on Nov 17, 2013 at 16:59 UTC
    Some of RTF::Tokenizer version 1.13:
    # Reads a line from an IO:File'ish object sub _get_line { my $self = shift(); # Turn off warnings for the rest of this sub (at some point I'll u +pgrade # to 'no warnings "uninitialized"', but don't want to force a Perl + version # on people yet) local ($^W); # Localize the input record separator before changing it so # we don't mess up any other part of the application running # us that relies on it local $/ = $self->{_IRS}; # Read the line itself $self->{_BUFFER} .= $self->{_FILEHANDLE}->getline(); # <-------- +Line 208 }

    It looks like there is an attempt to disable warnings in the sub. Does it not work?

    Also, this bug report looks relevant: Eliminate warnings when EOF is reached.

Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by zork42 (Monk) on Nov 17, 2013 at 17:25 UTC
    Thank you everyone for your comments!

    I suppose the easiest solution would be to edit Tokenizer.pm, but part of me thinks that is a Bad Thing! ;)

    I tried LanX's generic solution and it seems to work very well:
    use warnings; use strict; p(); print "Test 1\n\n"; print undef; # "Use of uninitialized value in print at . +.." print 'a'+1; # "Argument "a" isn't numeric in addition ( ++) at ..." foo(1); p(); { local $SIG{__WARN__} = \&suppress_UV_warning; # <-------- Is th +is correct ? p(); print "Test 2\n\n"; print undef; # SUPPRESSED! "Use of uninitialized value i +n print at ..." print 'a'+1; # "Argument "a" isn't numeric in addition ( ++) at ..." foo(2); p(); } p(); print "Test 3\n\n"; print undef; # "Use of uninitialized value in print at . +.." print 'a'+1; # "Argument "a" isn't numeric in addition ( ++) at ..." foo(3); p(); # generate some more warnings to check they are suppressed here too sub foo { my ($x) = @_; print "\n\n"; print undef; # SUPPRESSED IN TEST 2! "Use of uninitializ +ed value in print at ..." print "foo $x" + 1; # "Argument "foo n" isn't numeric in additi +on (+) at ..." } # suppress "Use of uninitialized value" warnings only sub suppress_UV_warning { my ($message) = @_; if ($message =~ /^Use of uninitialized value/) { return; } warn $message; # <-------- Is this correct ? } # print separating line sub p { print "\n", '-'x100, "\n"; }
    Produces this output:
    ---------------------------------------------------------------------- +------------------------------ Test 1 Use of uninitialized value in print at D:\test\test.pl line 7. Argument "a" isn't numeric in addition (+) at D:\test\test.pl line 8. 1 Use of uninitialized value in print at D:\test\test.pl line 38. Argument "foo 1" isn't numeric in addition (+) at D:\test\test.pl line + 39. 1 ---------------------------------------------------------------------- +------------------------------ ---------------------------------------------------------------------- +------------------------------ Test 2 Argument "a" isn't numeric in addition (+) at D:\test\test.pl line 19. 1 Argument "foo 2" isn't numeric in addition (+) at D:\test\test.pl line + 39. 1 ---------------------------------------------------------------------- +------------------------------ ---------------------------------------------------------------------- +------------------------------ Test 3 Use of uninitialized value in print at D:\test\test.pl line 27. Argument "a" isn't numeric in addition (+) at D:\test\test.pl line 28. 1 Use of uninitialized value in print at D:\test\test.pl line 38. Argument "foo 3" isn't numeric in addition (+) at D:\test\test.pl line + 39. 1 ---------------------------------------------------------------------- +------------------------------
    I have 2 questions, are these 2 lines correct?
    line 14 : local $SIG{__WARN__} = \&suppress_UV_warning;
    line 50 : warn $message;
      > I have 2 questions, are these 2 lines correct?

      Correct yes but...

      > line 14 : local $SIG{__WARN__} = \&suppress_UV_warning;

      Personally I prefer anonymous subs if I never need to call them by name.

      > line 50 : warn $message;

      You should check the Perl-version, IIRC this causes an endless loop in Perl older < 5.8 (?) (Too lazy to look up when it was exactly fixed)

      Newer versions are fool proof. ;-)

      update

      Talking about "generic solutions":

      Please be aware that this approach doesn't help if the module in question is also recklessly overwriting $SIG{__WARN__}

      Therefore a safe way of overriding is to create a wrapper, which calls the overridden handler from within (if present in $SIG{__WARN__}).

      But you can only be sure after checking the source code of the module in question.

      Cheers Rolf

      ( addicted to the Perl Programming Language)

Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by Khen1950fx (Canon) on Nov 17, 2013 at 18:29 UTC
    For a generic solution, see: warnings::everywhere.
    #!/usr/bin/perl -l use strict; no warnings::anywhere qw(uninitialized); use RTF::Tokenizer; use warnings qw(uninitialized); $| = 1; my $tokenizer = RTF::Tokenizer->new( file => \*DATA ); my ( $token_type, $argument, $parameter ); ( $token_type, $argument, $parameter ) = $tokenizer->get_token() until ( $token_type eq 'control' and $argument eq 'pard' ); while ( $token_type ne 'eof' ) { ( $token_type, $argument, $parameter ) = $tokenizer->get_token(); print "$argument " if $token_type eq 'text'; } __DATA__ {\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{ +\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New R +oman{\*\falt Times New Roman};}{\f1\fswiss\fcharset0\fprq2{\*\panose +020b0604020202020204}Arial{\*\falt Arial};} {\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier Ne +w{\*\falt Courier New};}{\f17\froman\fcharset238\fprq2 Times New Roma +n CE{\*\falt Times New Roman};}{\f18\froman\fcharset204\fprq2 Times N +ew Roman Cyr{\*\falt Times New Roman};} {\f20\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Times New + Roman};}{\f21\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt T +imes New Roman};}{\f22\froman\fcharset186\fprq2 Times New Roman Balti +c{\*\falt Times New Roman};} {\f23\fswiss\fcharset238\fprq2 Arial CE{\*\falt Arial};}{\f24\fswiss\f +charset204\fprq2 Arial Cyr{\*\falt Arial};}{\f26\fswiss\fcharset161\f +prq2 Arial Greek{\*\falt Arial};}{\f27\fswiss\fcharset162\fprq2 Arial + Tur{\*\falt Arial};} {\f28\fswiss\fcharset186\fprq2 Arial Baltic{\*\falt Arial};}{\f29\fmod +ern\fcharset238\fprq1 Courier New CE{\*\falt Courier New};}{\f30\fmod +ern\fcharset204\fprq1 Courier New Cyr{\*\falt Courier New};} {\f32\fmodern\fcharset161\fprq1 Courier New Greek{\*\falt Courier New} +;}{\f33\fmodern\fcharset162\fprq1 Courier New Tur{\*\falt Courier New +};}{\f34\fmodern\fcharset186\fprq1 Courier New Baltic{\*\falt Courier + New};}}{\colortbl;\red0\green0\blue0; \red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red2 +55\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255 +\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\g +reen128\blue0;\red128\green0\blue128; \red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\ +red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\cg +rid \snext0 Normal;}{\s1\keepn\widctlpar\adjustright \b\f1\cgrid \sba +sedon0 \snext0 heading 1;}{ \s2\qc\keepn\widctlpar\adjustright \b\f1\cgrid \sbasedon0 \snext0 head +ing 2;}{\*\cs10 \additive Default Paragraph Font;}{\s15\widctlpar\tx7 +20\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7 +920\tx8640\tx9360\tx10080\adjustright \f1\fs18\cgrid \snext15 RadPlus Text;}{\s16\nowidctlpar\adjustright \b +\cf2 \sbasedon0 \snext16 \sautoupd RadPlus Title;}{\s17\widctlpar\adj +ustright \f2\fs20\cgrid \sbasedon0 \snext17 Plain Text;}{\s18\widctlp +ar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid \sbasedon15 \snext +18 Arial 12 Point;}{\s19\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\fs22\cgrid \sbasedon17 \ +snext19 Arial 11 Point;}{\s20\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\fs20\cgrid \sbasedon15 \ +snext20 Arial 10 Point;}{\s21\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\fs28\cgrid \sbasedon15 \ +snext21 Arial 14 Point;}{\s22\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \fs18\cgrid \sbasedon15 \sne +xt22 Times New Roman 9 Point;}{\s23\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \fs20\cgrid \sbasedon15 \sne +xt23 Times New Roman 10 Point;}{\s24\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \fs22\cgrid \sbasedon15 \sne +xt24 Times New Roman 11 Point;}{\s25\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \cgrid \sbasedon15 \snext25 +Times New Roman 12 Point;}{\s26\widctlpar \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \fs28\cgrid \sbasedon15 \sne +xt26 Times New Roman 14 Point;}}{\info{\title CM}{\author RADTRANSWO4 +}{\operator RADTRANSWO6} {\creatim\yr2005\mo2\dy21\hr13\min7}{\revtim\yr2005\mo2\dy21\hr13\min7 +}{\version3}{\edmins0}{\nofpages1}{\nofwords0}{\nofchars0}{\*\company + MGHS}{\nofcharsws0}{\vern113}}\margl1080\margr360\margt360\margb360 \widowctrl\ftnbj\aenddoc\hyphcaps0\viewkind1\viewscale90 \fet0{\*\temp +late C:\\PB\\MLIVE\\word_fls\\QuickTxt.dot}{\*\docvar {ContainerApp}{ +RadPlus (MLIVE)}}{\*\docvar {IniFile}{C:\'5cPB\'5cTEMP\'5csession8\'5 +cmrq16871\'5cqt_coword.ini}} {\*\docvar {ParentHandle}{3015954}}{\*\docvar {TemplateDirectory}{C:\' +5cPB\'5cMLIVE\'5cword_fls\'5c}}\sectd \linex0\sectdefaultcl {\*\pnsec +lvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnuc +ltr\pnstart1\pnindent720\pnhang{\pntxta .}} {\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclv +l4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec +\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlc +ltr\pnstart1\pnindent720\pnhang{\pntxtb (} {\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb ( +}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxt +b (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pnt +xtb (}{\pntxta )}}\trowd \trgaph108\trleft2160 \trbrdrt\brdrdb\brdrw15\brdrcf1 \trbrdrl\brdrdb\brdrw15\brdrcf1 \trbrd +rb\brdrdb\brdrw15\brdrcf1 \trbrdrr\brdrdb\brdrw15\brdrcf1 \trbrdrh\br +drs\brdrw15\brdrcf1 \trbrdrv\brdrs\brdrw15\brdrcf1 \clvertalt\clbrdrt +\brdrdb\brdrw15\brdrcf1 \clbrdrl \brdrdb\brdrw15\brdrcf1 \clbrdrb\brdrs\brdrw15\brdrcf1 \clbrdrr\brdrs\ +brdrw15\brdrcf1 \cltxlrtb \cellx4284\clvertalt\clbrdrt\brdrdb\brdrw15 +\brdrcf1 \clbrdrl\brdrs\brdrw15\brdrcf1 \clbrdrb\brdrs\brdrw15\brdrcf +1 \clbrdrr\brdrs\brdrw15\brdrcf1 \cltxlrtb \cellx5670\clvertalt\clbrdrt\brdrdb\brdrw15\brdrcf1 \clbrdrl\brdrs\brd +rw15\brdrcf1 \clbrdrb\brdrs\brdrw15\brdrcf1 \clbrdrr\brdrdb\brdrw15\b +rdrcf1 \cltxlrtb \cellx7920\pard\plain \s18\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {\cell }\pard \s18 +\qc\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\b CM\cell }\pard \s18\widc +tlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\b WEEKS/DAYS\cell }\pard\p +lain \widctlpar\intbl\adjustright \fs20\cgrid {\caps \row }\trowd \tr +gaph108\trleft2160\trbrdrt \brdrdb\brdrw15\brdrcf1 \trbrdrl\brdrdb\brdrw15\brdrcf1 \trbrdrb\brdrd +b\brdrw15\brdrcf1 \trbrdrr\brdrdb\brdrw15\brdrcf1 \trbrdrh\brdrs\brdr +w15\brdrcf1 \trbrdrv\brdrs\brdrw15\brdrcf1 \clvertalt\clbrdrt\brdrs\b +rdrw15\brdrcf1 \clbrdrl\brdrdb\brdrw15\brdrcf1 \clbrdrb\brdrs\brdrw15\brdrcf1 \clbrdrr\brdrs\brdrw15\brdrcf1 \cltxlrt +b \cellx4284\clvertalt\clbrdrt\brdrs\brdrw15\brdrcf1 \clbrdrl\brdrs\b +rdrw15\brdrcf1 \clbrdrb\brdrs\brdrw15\brdrcf1 \clbrdrr\brdrs\brdrw15\ +brdrcf1 \cltxlrtb \cellx5670\clvertalt\clbrdrt \brdrs\brdrw15\brdrcf1 \clbrdrl\brdrs\brdrw15\brdrcf1 \clbrdrb\brdrs\b +rdrw15\brdrcf1 \clbrdrr\brdrdb\brdrw15\brdrcf1 \cltxlrtb \cellx7920\p +ard\plain \s18\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {\b BPD\cell }\par +d \s18\qc\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard \s18\widctlpar +\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard\plain \widctlp +ar\intbl\adjustright \fs20\cgrid {\row }\pard\plain \s18\widctlpar\in +tbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {\b HC\cell }\pard + \s18\qc\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard \s18\widctlpar +\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard\plain \widctlp +ar\intbl\adjustright \fs20\cgrid {\row }\pard\plain \s18\widctlpar\in +tbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {\b AC\cell }\pard + \s18\qc\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard \s18\widctlpar +\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard\plain \widctlp +ar\intbl\adjustright \fs20\cgrid {\row }\pard\plain \s18\widctlpar\in +tbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {\b Femur Length\c +ell }\pard \s18\qc\widctlpar\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard \s18\widctlpar +\intbl \tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\ +tx7920\tx8640\tx9360\tx10080\adjustright {\cell }\pard\plain \widctlp +ar\intbl\adjustright \fs20\cgrid {\row }\trowd \trgaph108\trleft2160\ +trkeep\trbrdrt\brdrdb\brdrw15\brdrcf1 \trbrdrl \brdrdb\brdrw15\brdrcf1 \trbrdrb\brdrdb\brdrw15\brdrcf1 \trbrdrr\brdrd +b\brdrw15\brdrcf1 \trbrdrh\brdrs\brdrw15\brdrcf1 \trbrdrv\brdrs\brdrw +15\brdrcf1 \clvertalt\clbrdrt\brdrs\brdrw15\brdrcf1 \clbrdrl\brdrdb\b +rdrw15\brdrcf1 \clbrdrb\brdrdb\brdrw15\brdrcf1 \clbrdrr\brdrdb\brdrw15\brdrcf1 \cltxlrtb \cellx7920\pard\plain \s18\w +idctlpar\intbl\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760 +\tx6480\tx7200\tx7920\tx8640\tx9360\tx10080\adjustright \f1\cgrid {A +regular fetal heart rate of ? beats per minute is seen.\cell }\pard\plain \widctlpar\intbl\adjustright \fs20\cgrid { +\row }\pard\plain \s15\widctlpar\tx720\tx1440\tx2160\tx2880\tx3600\tx +4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\tx9360\tx10080\adjustr +ight \f1\fs18\cgrid { \par }}
Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by ysth (Canon) on Nov 18, 2013 at 06:42 UTC
    The first question is: why is it generating warnings in the first place? If you are using -w or -W, stop; instead lexically enable warnings with use warnings; only for your own code.
    --
    A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |
      Thanks, but maybe you missed the thread title. My code is warning free, but I'm getting warnings from a CPAN module.
        And I asked "why?" Uninitialized warnings don't just happen; either you are enabling them even on code other than your own, or the CPAN module is enabling warnings but not coded to avoid generating them (a bug), or you are using the CPAN module in an unsupported way.
        --
        A math joke: r = | |csc(θ)|+|sec(θ)| |-| |csc(θ)|-|sec(θ)| |
Re: How can I suppress 'uninitialized' warnings in a CPAN module?
by zork42 (Monk) on Nov 20, 2013 at 16:51 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1062996]
Approved by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-07-10 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (214 votes), past polls