From 0ca820942675126fc56ee5a83d8c533552b33365 Mon Sep 17 00:00:00 2001 From: Damian Conway Date: Fri, 23 Nov 2007 18:43:05 +1100 Subject: [PATCH] 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 --- lib/Attribute/Handlers.pm | 4 +--- lib/Attribute/Handlers/t/data_convert.t | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) 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/) { -- 2.7.4