From: Shawn M Moore Date: Wed, 4 Jun 2008 04:02:45 +0000 (+0000) Subject: Future-proof init_arg => undef, that needs tests though X-Git-Tag: 0.04~99 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=7ee01d77a48acfaaf20e6c2488781344953dec78;hp=b250019157d54598932f9e3e2a82f56c9a8937dd Future-proof init_arg => undef, that needs tests though --- diff --git a/lib/Mouse/Attribute.pm b/lib/Mouse/Attribute.pm index 2c8cc5b..325c24d 100644 --- a/lib/Mouse/Attribute.pm +++ b/lib/Mouse/Attribute.pm @@ -9,7 +9,8 @@ sub new { my $class = shift; my %args = @_; - $args{init_arg} ||= $args{name}; + $args{init_arg} = $args{name} + unless exists $args{init_arg}; $args{is} ||= ''; bless \%args, $class;