Monks,

I am sure this should not be complicated:

#!/usr/bin/perl use strict; use warnings; use diagnostics; use Getopt::Std; use DBI; use DateTime; use FileHandle; use Socket; use lib q(/home/dds/utils); use DDSUtils; # a few 'my $thisNthat;'s ... print "$0: ",(scalar localtime), "\n"; # do stuff... print "$0: " ,(scalar localtime), " run complete\n"; $Odbh->disconnect; exit;

Compiles OK, but when it runs:

qg@dev:~/svnwork/dds/trunk/src$ ./alerts.pl ./alerts.pl: Tue Oct 21 11:32:20 2008 ./alerts.pl: Tue Oct 21 11:32:21 2008 run complete Use of uninitialized value in require at /usr/share/perl/5.8/AutoLoade +r.pm line 92 during global destruction (#1) (W uninitialized) An undefined value was used as if it were alread +y defined. It was interpreted as a "" or a 0, but maybe it was a mi +stake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl tells you what ope +ration you used the undefined value in. Note, however, that perl optimiz +es your program and the operation displayed in the warning may not necessa +rily appear literally in your program. For example, "that $foo" is usually optimized into "that " . $foo, and the warning will refer +to the concatenation (.) operator, even though there is no . in your program.

It now gets interesting ... As I was composing this node I thought "these monks don't want to see the long diagnostic explanation of the warning - I'll comment out the 'use diagnostics;' and just get the brief warning"...

qg@dev:~/svnwork/dds/trunk/src$ !! ./alerts.pl ./alerts.pl: Tue Oct 21 11:32:53 2008 ./alerts.pl: Tue Oct 21 11:32:54 2008 run complete qg@dev:~/svnwork/dds/trunk/src$

The only difference between the two runs is that I commented out the

use diagnostics;
line. But it seems to have made the warning go away.

¿Qué pasa?


This signature will be ready by Christmas

In reply to Use of uninitialized value in require at ...AutoLoader.pm ? by jvector

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.