… | |
… | |
247 | |
247 | |
248 | no warnings; |
248 | no warnings; |
249 | use strict; |
249 | use strict; |
250 | use Carp; |
250 | use Carp; |
251 | |
251 | |
252 | our $VERSION = '2.5'; |
252 | our $VERSION = '2.51'; |
253 | our $MODEL; |
253 | our $MODEL; |
254 | |
254 | |
255 | our $AUTOLOAD; |
255 | our $AUTOLOAD; |
256 | our @ISA; |
256 | our @ISA; |
257 | |
257 | |
… | |
… | |
288 | unless ($MODEL) { |
288 | unless ($MODEL) { |
289 | # try to load a model |
289 | # try to load a model |
290 | |
290 | |
291 | for (@REGISTRY, @models) { |
291 | for (@REGISTRY, @models) { |
292 | my ($package, $model) = @$_; |
292 | my ($package, $model) = @$_; |
|
|
293 | if (eval "require $package" |
|
|
294 | and ${"$package\::VERSION"} > 0 |
293 | if (eval "require $model") { |
295 | and eval "require $model") { |
294 | $MODEL = $model; |
296 | $MODEL = $model; |
295 | warn "AnyEvent: autoprobed and loaded model '$model', using it.\n" if $verbose > 1; |
297 | warn "AnyEvent: autoprobed and loaded model '$model', using it.\n" if $verbose > 1; |
296 | last; |
298 | last; |
297 | } |
299 | } |
298 | } |
300 | } |