Red_Dragon has asked for the wisdom of the Perl Monks concerning the following question:

Wise Ones,

After having installed Perl 5.10, my script now issues these messages each time it runs:

Subroutine connect redefined at E:/Perl/lib/DBD/ODBC.pm line 81.
Subroutine parse_trace_flag redefined at E:/Perl/lib/DBD/ODBC.pm line 118.
Subroutine private_attribute_info redefined at E:/Perl/lib/DBD/ODBC.pm line 123.
Subroutine prepare redefined at E:/Perl/lib/DBD/ODBC.pm line 143.
Subroutine column_info redefined at E:/Perl/lib/DBD/ODBC.pm line 161.
Subroutine columns redefined at E:/Perl/lib/DBD/ODBC.pm line 177.
Subroutine table_info redefined at E:/Perl/lib/DBD/ODBC.pm line 194.

is there some way to shut this off?

Replies are listed 'Best First'.
Re: How do I curtail the noise
by Corion (Patriarch) on Jul 13, 2010 at 20:14 UTC

    Don't load DBD::ODBC twice. On Windows this can happen inadverently by having two statements like:

    use DBD::Odbc; use dBd::ODBC;

    or , in the case of DBI, having two connection strings that are not uppercase:

    dbi:ODBC:...

      This isn't something I've looked into, but doesn't Perl have some mechanism to prevent loading the same module twice? I know I've seen something like this in C #include files -- one of the first lines is an #ifdef that checks to see if this file has been included already, and if so, skips the entire file.

      As a corollary, why would a developer want to load a module twice?

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        Perl uses %INC to keep track of require'd files. On case-insensitive file systems, you can load the same file under more than one name. For example:

        use Strict;

        loads strict.pm but never calls its import method.

Re: How do I curtail the noise
by ww (Archbishop) on Jul 13, 2010 at 20:54 UTC
    That's not noise; that's the sound of your code trying to help you get it right.