Investigation continues. The issue is running the subroutine in separate threads. And when l wrote this some years ago, l put a comment about the following code.

It looks like this code no longer works, i.e. the refined warnings continue. It is the connect_to_database code that is triggering the redefin warnings.

I removed use warnings altogether, replaced the code below with no warnings in different varieties - but CANNOT remove the redefined warnings.

Any suggestions? I need each thread to hold a separate connection to the database.

###################################################################### +######### # Function: connect_to_database # Purpose: Connect to the Oracle database # Arguments: $db_uid, $db_pwd, $db_sid # Returns: $dbh ###################################################################### +######### sub connect_to_database($$$) { # Declare the variables my ($db_uid, $db_pwd, $db_sid) = @_; my $dbh; my %attribs = ( PrintError => 0, AutoCommit => 0, RaiseError => 0 ); $dbh = DBI->connect("DBI:Oracle:".$db_sid, $db_uid, $db_pwd , +\%attribs ) or die "ERROR: Can't connect to database ($db_uid\@$d +b_sid): ".$DBI::errstr."\n"; return $dbh; } ..... # Remove erroneous "subroutine redefined" warning { BEGIN { $^W = 0 } $dbh = connect_to_database($db_uid, $db_pwd, $db_sid); }

In reply to Re: Cannot Remove Redefined Warnings by Sukhster
in thread Cannot Remove Redefined Warnings by Sukhster

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.