From: Damian Conway Date: Fri, 23 Nov 2007 07:43:05 +0000 (+1100) Subject: Change to Attribute::Handlers suggested by Damian in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ca820942675126fc56ee5a83d8c533552b33365;p=p5sagit%2Fp5-mst-13.2.git Change to Attribute::Handlers suggested by Damian in Subject: Re: [PATCH] Attribute::Handlers till ears are bleeding Message-ID: <4745E9D9.1050102@conway.org> p4raw-id: //depot/perl@32488 --- diff --git a/lib/Attribute/Handlers.pm b/lib/Attribute/Handlers.pm index ac3db28..0cf380c 100644 --- a/lib/Attribute/Handlers.pm +++ b/lib/Attribute/Handlers.pm @@ -192,9 +192,7 @@ sub _apply_handler_AH_ { no warnings; my $evaled = !$raw && eval("package $pkg; no warnings; no strict; local \$SIG{__WARN__}=sub{die}; [$data]"); - $data = ($evaled && $data =~ /^\s*\[/) ? [$evaled] - : ($evaled) ? $evaled - : [$data]; + $data = $evaled || [$data]; $pkg->$handler($sym, (ref $sym eq 'GLOB' ? *{$sym}{ref $ref}||$ref : $ref), $attr, diff --git a/lib/Attribute/Handlers/t/data_convert.t b/lib/Attribute/Handlers/t/data_convert.t index 56e66c4..b0c37c3 100644 --- a/lib/Attribute/Handlers/t/data_convert.t +++ b/lib/Attribute/Handlers/t/data_convert.t @@ -26,7 +26,7 @@ sub test1 :Loud(till=>ears=>are=>bleeding) { } sub test2 :Loud(['till','ears','are','bleeding']) { - [[qw(till ears are bleeding)]] + [qw(till ears are bleeding)] } sub test3 :Loud(qw/till ears are bleeding/) {