in reply to Can't time out a $sth-fetchrow()

Your die string will not be $timeoutstr so you need to use =~ on line 29.

Also:

You might want to take a look at Signal Handling and Canceling Operations.

I use signals with DBD::Oracle but I use Sys::SigAction.

An alternative (although I'm not sure it is available for DBD::Oracle) is asynchronous operations which some DBDs support.

Replies are listed 'Best First'.
Re^2: Can't time out a $sth-fetchrow()
by Skeeve (Parson) on May 27, 2011 at 08:24 UTC

    Why do you think, my die string will not be $timeoutstr? I'm just curious because now, where I use what you also suggested, Sys::SigAction, it works. The "eq" also works.


    s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
    +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

      Because it contains something like "timeout at x.pl line 16." because Perl added the line number.

        Understood. Thanks! That's why my $timeoutstr contains a trailing "\n". So no "at line..." is added


        s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
        +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e