From: Alex J. G. BurzyƄski Date: Fri, 29 Jul 2011 11:20:24 +0000 (+0100) Subject: die rather than warn on odd number of arguments X-Git-Tag: v0.009011~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbed1e70409e083df0e8a96e6bf6cc70a59010ed;p=gitmo%2FRole-Tiny.git die rather than warn on odd number of arguments --- diff --git a/lib/Moo/Object.pm b/lib/Moo/Object.pm index 70daca4..412acf4 100644 --- a/lib/Moo/Object.pm +++ b/lib/Moo/Object.pm @@ -28,9 +28,8 @@ sub BUILDARGS { return { %{ $_[0] } }; } elsif ( @_ % 2 ) { - warn "The new() method for $class expects a hash reference or a key/value list." + die "The new() method for $class expects a hash reference or a key/value list." . " You passed an odd number of arguments"; - return { @_, undef }; } else { return {@_};