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=2c2bc41d2dac3dd27be2bf0530f3d74f253a1799;hp=c9f19cd1d3ed76affc5a673e319200559f4799a2;hb=77afca3b1e24dee5bc1cecbc30fd3be9ea448889;hpb=4748f060c5038b49fa96c3be95b28deb88a7a323 diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index c9f19cd..2c2bc41 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.24'; +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 $err = do { + local $@; + @configs = eval { $loader->load( $filename, $loader_args{ $loader } ); }; + $@; + }; # fatal error if we used extension matching - croak "Error parsing $filename: $@" if $@ and $use_ext_lut; - next if $@ or !@configs; + croak "Error parsing $filename: $err" if $err and $use_ext_lut; + next if $err or !@configs; # post-process config with a filter callback if ( $args->{ filter } ) {