in reply to $@ alternative

Not what you asked about, but I thought I should point out that your code may cause hard to trace memory corruption. Your DBD driver is likely XS code linking to a compiled client library, most are. Interupting code like that with a signal and then trying to call back into that code will work most of the time, until it doesn't. When it doesn't you'll get very bizarre results - crashes in unrelated areas of code for example. The reason is that your DBD driver may be keeping global state which is left in an inconsistent state by your alarm interupt.

I wrote DBIx::Timeout to deal with this problem. It only works for MySQL at the moment but I believe the concept should be portable.

-sam

Replies are listed 'Best First'.
Re^2: $@ alternative
by Gangabass (Vicar) on Sep 11, 2007 at 06:06 UTC

    Thanks! I'll take a look to it.