X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FConfig-Any.git;a=blobdiff_plain;f=lib%2FConfig%2FAny.pm;h=7bdf2a64a24259cd649cf686f1d6b713d0ed8f51;hp=4033b493f65ad2822f6893ecec2d2f6bbf052561;hb=f9f3d682a0332cec1207764dcada85a7ff7750f0;hpb=ccae701a16202e102e8bc521f1cdf00d0747042b diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index 4033b49..7bdf2a6 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -6,7 +6,7 @@ use warnings; use Carp; use Module::Pluggable::Object (); -our $VERSION = '0.21'; +our $VERSION = '0.25'; =head1 NAME @@ -194,12 +194,16 @@ sub _load { for my $loader ( @try_plugins ) { next unless $loader->is_supported; $supported = 1; - my @configs - = eval { $loader->load( $filename, $loader_args{ $loader } ); }; + my @configs; + my $ok = do { + local $@; + @configs = eval { $loader->load( $filename, $loader_args{ $loader } ); }; + 1; + }; # fatal error if we used extension matching - croak "Error parsing $filename: $@" if $@ and $use_ext_lut; - next if $@ or !@configs; + croak "Error parsing $filename: $@" if !$ok and $use_ext_lut; + next if !$ok or !@configs; # post-process config with a filter callback if ( $args->{ filter } ) {