--- AnyEvent/lib/AnyEvent.pm 2006/12/11 01:16:09 1.20 +++ AnyEvent/lib/AnyEvent.pm 2007/04/11 00:36:59 1.25 @@ -163,7 +163,7 @@ You can listen for signals using a signal watcher, C is the signal I without any C prefix. Multiple signals events can be clumped -together into one callback invocation, and callbakc invocation might or +together into one callback invocation, and callback invocation might or might not be asynchronous. These watchers might use C<%SIG>, so programs overwriting those signals @@ -247,9 +247,10 @@ no warnings; use strict; + use Carp; -our $VERSION = '2.5'; +our $VERSION = '2.52'; our $MODEL; our $AUTOLOAD; @@ -290,7 +291,9 @@ for (@REGISTRY, @models) { my ($package, $model) = @$_; - if (eval "require $model") { + if (eval "require $package" + and ${"$package\::VERSION"} > 0 + and eval "require $model") { $MODEL = $model; warn "AnyEvent: autoprobed and loaded model '$model', using it.\n" if $verbose > 1; last; @@ -386,12 +389,14 @@ $PID_CB{$pid}{$arg{cb}} = $arg{cb}; unless ($WNOHANG) { - $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_child_wait); $WNOHANG = eval { require POSIX; &POSIX::WNOHANG } || 1; } - # child could be a zombie already - $PID_IDLE ||= AnyEvent->timer (after => 0, cb => \&_child_wait); + unless ($CHLD_W) { + $CHLD_W = AnyEvent->signal (signal => 'CHLD', cb => \&_child_wait); + # child could be a zombie already + $PID_IDLE ||= AnyEvent->timer (after => 0, cb => \&_child_wait); + } bless [$pid, $arg{cb}], "AnyEvent::Base::Child" } @@ -437,7 +442,7 @@ I also cheats a bit by not providing blocking access to condition variables: code blocking while waiting for a condition will C. This still works with most modules/usages, and blocking calls must -not be in an interactive appliation, so it makes sense. +not be in an interactive application, so it makes sense. =head1 ENVIRONMENT VARIABLES