From: Lukas Mai Date: Fri, 22 Jun 2012 21:42:02 +0000 (+0200) Subject: enable default arguments by default X-Git-Tag: v0.06_01~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59f51b8bd14b6b5ab68b3375f00cb122f0cfacba;p=p5sagit%2FFunction-Parameters.git enable default arguments by default --- diff --git a/lib/Function/Parameters.pm b/lib/Function/Parameters.pm index e84c3de..8af625e 100644 --- a/lib/Function/Parameters.pm +++ b/lib/Function/Parameters.pm @@ -91,7 +91,11 @@ sub import { $clean{attrs} = delete $type{attrs} || ''; _assert_valid_attributes $clean{attrs} if $clean{attrs}; - $clean{default_arguments} = !!delete $type{default_arguments}; + $clean{default_arguments} = + exists $type{default_arguments} + ? !!delete $type{default_arguments} + : 1 + ; $clean{check_argument_count} = !!delete $type{check_argument_count}; %type and confess "Invalid keyword property: @{[keys %type]}";