From: Thomas Sibley Date: Fri, 6 Nov 2015 02:55:27 +0000 (-0800) Subject: Parse attributes with empty parens as undef X-Git-Tag: 0.090103~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=698e6f195c0042787d76387c9c0a9b10ed445e79 Parse attributes with empty parens as undef This fixes parsing of Path() to be the same as Path, resolving GH #104, without breaking Args(). --- diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index d0a8570..0203b29 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -399,7 +399,7 @@ sub _parse_attrs { # Parse out :Foo(bar) into Foo => bar etc (and arrayify) - if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)\s*\))?$/ ) ) + if ( my ( $key, $value ) = ( $attr =~ /^(.*?)(?:\(\s*(.+?)?\s*\))?$/ ) ) { if ( defined $value ) {