Change to Attribute::Handlers suggested by Damian in
Damian Conway [Fri, 23 Nov 2007 07:43:05 +0000 (18:43 +1100)]
Subject: Re: [PATCH] Attribute::Handlers till ears are bleeding
Message-ID: <4745E9D9.1050102@conway.org>

p4raw-id: //depot/perl@32488

lib/Attribute/Handlers.pm
lib/Attribute/Handlers/t/data_convert.t

index ac3db28..0cf380c 100644 (file)
@@ -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,
index 56e66c4..b0c37c3 100644 (file)
@@ -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/) {