18 Use of uninitialized value at /opt/perl-5.005/lib/site_perl/5.005/sun4-solaris/Sybase/DBlib.pm l

Discussion in 'Perl Misc' started by ramanmu, May 16, 2005.

  1. ramanmu

    ramanmu Guest

    I get the 'undefined' error, as noted in the Subject line, whenever I
    initialize the $Sybase::DBlib::nsql_deadlock_retrycount var.

    Line 450 of /opt/perl.../DBlib.pm looks like this:
    406 sub nsql {
    407
    408 my ($db,$sql,$type,$callback) = @_;
    409 my (@res,@data,%data);
    410 my $retrycount = $nsql_deadlock_retrycount;
    411 my $retrysleep = $nsql_deadlock_retrysleep || 60;
    412 my $retryverbose = $nsql_deadlock_verbose;
    413
    414 if ( ref $type ) {
    415 $type = ref $type;
    416 }
    417 elsif ( not defined $type ) {
    418 $type = "";
    419 }
    420
    421 undef $DB_ERROR;
    422
    423 DEADLOCK:
    424 {
    425
    426 return unless $db->dbcmd($sql);
    427
    428 unless ( $db->dbsqlexec ) {
    429
    430 if ( $nsql_deadlock_retrycount && $DB_ERROR =~
    /Message: 1205\b/m ) {
    431 if ( $retrycount < 0 || $retrycount-- ) {
    432 carp "SQL deadlock encountered.
    Retrying...\n" if $retryverbose;
    433 undef $DB_ERROR;
    434 sleep($retrysleep);
    435 redo DEADLOCK;
    436 }
    437 else {
    438 carp "SQL deadlock retry failed
    $nsql_deadlock_retrycount times. Aborting.\n"
    439 if $retryverbose;
    440 last DEADLOCK;
    441 }
    442 }
    443


    444 last DEADLOCK;
    445
    446 }
    447
    448 while ( $db->dbresults != $db->NO_MORE_RESULTS ) {
    449
    450 if ( $nsql_deadlock_retrycount && $DB_ERROR =~
    /Message: 1205\b/m ) {
    451 if ( $retrycount < 0 || $retrycount-- ) {
    452 carp "SQL deadlock encountered.
    Retrying...\n" if $retryverbose;
    453 undef $DB_ERROR;
    454 @res = ();
    455 sleep($retrysleep);
    456 redo DEADLOCK;
    457 }
    458 else {
    459 carp "SQL deadlock retry failed
    $nsql_deadlock_retrycount times. Aborting.\n"
    460 if $retryverbose;
    461 last DEADLOCK;
    462 }
    463 }

    Can someone help please?

    The 'undefined' error messages are filling up my log files & I'm not
    able to figure out what exactly is getting undefined.

    If I understand this piece of code correctly, it appears to me that
    $DB_ERROR is undef'ed at line 421. Then, assuming that everything
    proceeds without any errors & deadlocks, when the test for $DB_ERROR is
    made in line 450 it is still undef'ed which in turn causes the error
    message.

    Any & all help would be greatly appreciated.
    thanks,
    Murali.
    ramanmu, May 16, 2005
    #1
    1. Advertising

  2. "ramanmu" <> wrote in
    news::

    > Subject: 18 Use of uninitialized value at /opt/perl-
    > 5.005/lib/site_perl/5.005/sun4-solaris/Sybase/DBlib.pm line 450.


    Please try to choose better subject lines than this.

    In fact, the posting guidelines for this group contain valuable
    information on how you can help others help you.

    <snip long code snipped from Sybase::DBlib>

    Did you check if the problem still manifests itself with the newest
    version of the module (from April 2005) available on CPAN?

    <URL: http://search.cpan.org/~mewp/sybperl-2.18/>

    Taking a cursory look, it seems like the current version of the module
    is turning off warnings in this section of the code.

    If you do not want to or cannot upgrade, you might want to do the same
    in your code. You should be able to use

    no warnings 'uninitialized';

    in the smallest lexical scope in your code where this problem applies to
    turn off warnings.

    I cannot test it here because I do not have the module installed.

    > made in line 450 it is still undef'ed which in turn causes the error
    > message.


    That is not an error message.

    Sinan
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, May 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. laredotornado
    Replies:
    4
    Views:
    1,938
    John B. Matthews
    Oct 17, 2009
  2. yubo he

    how to install Sybase::DBlib???

    yubo he, Aug 22, 2004, in forum: Perl Misc
    Replies:
    2
    Views:
    862
    Michael Peppler
    Aug 23, 2004
  3. Nirvana
    Replies:
    1
    Views:
    718
    Michele Dondi
    Nov 27, 2004
  4. Gancy
    Replies:
    2
    Views:
    114
    Anno Siegel
    Jan 27, 2005
  5. Shmuel (Seymour J.) Metz
    Replies:
    0
    Views:
    332
    Shmuel (Seymour J.) Metz
    May 21, 2006
Loading...

Share This Page