From: Gordon Irving Date: Wed, 30 Sep 2009 10:54:55 +0000 (+0100) Subject: add $class as instance to default X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6c4ca4de61c26b587d71b5062acfc5e198ceaf95;p=gitmo%2FMooseX-Getopt.git add $class as instance to default --- diff --git a/lib/MooseX/Getopt.pm b/lib/MooseX/Getopt.pm index 90a9d77..5c916bd 100644 --- a/lib/MooseX/Getopt.pm +++ b/lib/MooseX/Getopt.pm @@ -30,7 +30,7 @@ sub new_with_options { if(!defined $configfile) { my $cfmeta = $class->meta->find_attribute_by_name('configfile'); - $configfile = $cfmeta->default if $cfmeta->has_default; + $configfile = $cfmeta->default($class) if $cfmeta->has_default; if (defined $configfile) { $config_from_file = eval { $class->get_config_from_file($configfile);