Apparently Autoloader is doing require undef; if there is an undef value in @INC when DBI's connect method is called.

This code generates the warning if the line push  @INC,$ENV{'PERL5LIB'}; is executed before the call to DBI->connect. It's not clear what the push  @INC,$ENV{'PERL5LIB'}; is actually meant to be doing (this code has been copied from a system that was built several years ago).

The code connects to an Oracle database. Obviously it will not work with someone else's Oracle DB. If you do not have an Oracle database I do not know if the same issue shows up with other DBD drivers. I did see the same Autoloader warning appearing when I ran the code with invalid connect parameters, but don't know what was being complained about.

#!/usr/bin/perl use strict; use warnings; use diagnostics -warntrace; # the -warntrace does not seem to help B-( use DBI; sub db_connect; my $Odbh; # database handle returned by connect to Oracle print "$0: ",(scalar localtime), "\n"; #exit; #no warn if exit before db_connect call &db_connect; exit; # yes warn if exit after connect print "$0: " ,(scalar localtime), " run complete\n"; $Odbh->disconnect; #exit; # yes warn if exit after connect + disconnect ################ sub db_connect { ################ my ($dsn, $dbuser, $dbpassword) = ("DBI:Oracle:qq3","nn2","nn2"); # # Connect to Oracle # # if the push on the next line is commented out there is no warning. push @INC,$ENV{'PERL5LIB'}; # location of libs for DBD::Oracle print "ENV= [",join ("]\n[",@INC),"]\n"; $Odbh = DBI->connect($dsn, $dbuser, $dbpassword, { RaiseError => 1, AutoCommit => 1 }) or warn "Can't connect to $dsn: $DBI::errstr"; }

This signature will be ready by Christmas

In reply to Re^4: Use of uninitialized value in require at ...AutoLoader.pm ? by jvector
in thread 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.