From: Karen Etheridge Date: Fri, 8 Feb 2013 01:07:28 +0000 (-0800) Subject: handle configfile values of "0" X-Git-Tag: v0.08~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a665bd300aafc39a938cd72ff1fb2f1c2a584175;p=gitmo%2FMooseX-ConfigFromFile.git handle configfile values of "0" --- diff --git a/ChangeLog b/ChangeLog index 17aacb3..395d779 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Revision history for Perl extension MooseX::ConfigFromFile + - allow configfiles called "0" + 0.07 - 2013-02-04 (Karen Etheridge) - fixed tests to not load optional dependencies diff --git a/lib/MooseX/ConfigFromFile.pm b/lib/MooseX/ConfigFromFile.pm index bb5b984..7a12bc2 100644 --- a/lib/MooseX/ConfigFromFile.pm +++ b/lib/MooseX/ConfigFromFile.pm @@ -35,7 +35,7 @@ sub new_with_config { # default subs, we have to keep calling it rather than calling a # builder sub directly - and it might not even be a coderef either my $cfmeta = $class->meta->find_attribute_by_name('configfile'); - $configfile ||= $cfmeta->default if $cfmeta->has_default; + $configfile = $cfmeta->default if not defined $configfile and $cfmeta->has_default; if (ref $configfile eq 'CODE') { $configfile = $configfile->($class);