Hi! I am using Event in a peculiar environment where I get called regularly every 0.12s and have to return and cannot modify the mainloop.
Therefore, I do the moral equivalent of: 1 while Event::one_event 0; to do event processing on every call. I also ste an $Event::DIED handler that logs the error message of any error calllback, as per the manpage. Now, the argument passed to that callback ALWAYS has "?" as error message, and never the real error message. While looking through the code in c/ev.c, I saw that Event actually sets it to "?" when !SvTRUE(ERRSV). I also found the undocumented variable $Event::Eval. I found that I do get correct error reporting when $Event::Eval is set to 1, and "?" when it is left alone. Now, the documentation for "cb" says that Event::DIED is always called, while the doumentation for Event::DIED says its only called within loop or sweep contexts. In my case, $Event::DIED is called from one_event(0), but the error passed is "?". I think one_event either shouldn't catch the exception and pass it through (as per $Event::DIED doc) or it should catch it, but pass it to the $Event::DIED handler. The code that creates the exception is: Event->timer (interval => 0.2, cb => sub { &vhkhvjbv; }); Where vhkhvjbv is not defined. $Event::DIED = sub { warn "error in event callback: @_"; }; The code that calls one_event (very inafficient, maybe one_event + sweep does what I want? The documnetation on what sweep and one_event do is very fuzzy) is: ENTER; SAVETMPS; for (i = 9; --i; ) { PUSHMARK (SP); XPUSHs (sv_2mortal (newSViv (0))); PUTBACK; count = call_pv ("Event::one_event", G_SCALAR | G_EVAL); SPAGAIN; if (!count || !POPi) break; } FREETMPS; LEAVE; And the output I get when the timer fires is: error in event callback: Event::Event=SCALAR(0x1a40560) ? error in event callback: Event::Event=SCALAR(0x1b33290) ? error in event callback: Event::Event=SCALAR(0x1550360) ? When I wrap my cb sub into eval { ... }; warn "$@"; die if $@; I get the correct error message in the warn, but $Event::DIED still gives me "?". I never once call loop, sweep or anything else that could invoke watchers except for one_event(0). -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ [EMAIL PROTECTED] --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE