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

Hello Wise Monks, I need a way to exit out of my Perl code once an ODBC call has been made. Until now, the minute I issue a:
$dbh = new Win32::ODBC("DSN=$dsn1;UID=$user;PWD=$pw;");
I no longer have the ability to shutdown my Perl process EVEN after I have issued a:
$dbh->Close( );
Is there a place I can specify that ODBC not eat my "Control C" when I issue one. Ideas? Thank you! EP

Edit: Added <code> tags. larsen

Replies are listed 'Best First'.
Re: Cannot exit Perl process once ODBC call has been made
by talexb (Chancellor) on Mar 19, 2003 at 22:37 UTC

    What have you tried so far?

    • How about the Perl debugger?
    • How about DBI::trace?
    • How about just putting 'print "foo!";' in place of your database stuff?

    --t. alex
    Life is short: get busy!

    Update: D'Oh. OK, DBI::trace isn't going to work when Win32::ODBC is being used, as bart points out. My point (blunt though it was) was to look at all of the links in the chain.

      DBI::trace? When he's not even using DBI, but Win32::ODBC? No kidding...

      Perhaps the OP could indeed try using DBI+DBD::ODBC instead. I see no %SIG manipulation in the perl source of Win32::ODBC — $SIG{INT} is the way to capture the signal coming from ctrl-C. So I can only guess that it hangs in the XS part (the DLL) of this module...