X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FConfig%2FAny%2FPerl.pm;h=625839262e41c60e78686ab976721cd28627cee4;hb=9dbebe277d9dc4fef8eee9a57b8e2475a125b403;hp=2798d87e09a845c50be0f1f85e7c61c9e1de6d9e;hpb=dcfb1d1d1a544d27a82cb174168df23abc539acb;p=p5sagit%2FConfig-Any.git diff --git a/lib/Config/Any/Perl.pm b/lib/Config/Any/Perl.pm index 2798d87..6258392 100644 --- a/lib/Config/Any/Perl.pm +++ b/lib/Config/Any/Perl.pm @@ -5,8 +5,6 @@ use warnings; use base 'Config::Any::Base'; -my %cache; - =head1 NAME Config::Any::Perl - Load Perl config files @@ -46,12 +44,14 @@ Attempts to load C<$file> as a Perl file. sub load { my $class = shift; my $file = shift; - my $content; - unless ( $content = $cache{ $file } ) { - $content = require $file; - $cache{ $file } = $content; + my( $exception, $content ); + { + local $@; + $content = do $file; + $exception = $@; } + die $exception if $exception; return $content; } @@ -62,7 +62,7 @@ Brian Cassidy Ebricas@cpan.orgE =head1 COPYRIGHT AND LICENSE -Copyright 2007 by Brian Cassidy +Copyright 2006-2010 by Brian Cassidy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.