summaryrefslogtreecommitdiff
path: root/lib/Attribute/Handlers.pm
diff options
context:
space:
mode:
authorSascha Blank <unknown>2007-12-07 19:47:46 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-12-08 23:28:41 +0000
commitb384a05d76a2022ec642d8bd7b87bb7147132641 (patch)
treeec664e0256ba8c1b5b4448dc1cba5816a3d6a4f2 /lib/Attribute/Handlers.pm
parent25ff843968f41a8aa0535a62280b51007713d2eb (diff)
downloadperl-b384a05d76a2022ec642d8bd7b87bb7147132641.tar.gz
[perl #48355] Handling of RAWDATA broken badly in Attribute::Handlers in perl 5.10.0 RC2
From: Sascha Blank (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.6.HEAD-28750-1197114466-1411.48355-75-0@perl.org> p4raw-id: //depot/perl@32598
Diffstat (limited to 'lib/Attribute/Handlers.pm')
-rw-r--r--lib/Attribute/Handlers.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Attribute/Handlers.pm b/lib/Attribute/Handlers.pm
index e035a14b6f..6c7b3f5c4f 100644
--- a/lib/Attribute/Handlers.pm
+++ b/lib/Attribute/Handlers.pm
@@ -190,9 +190,14 @@ sub _apply_handler_AH_ {
my $sym = findsym($pkg, $ref);
$sym ||= $type eq 'CODE' ? 'ANON' : 'LEXICAL';
no warnings;
- my $evaled = !$raw && eval("package $pkg; no warnings; no strict;
- local \$SIG{__WARN__}=sub{die}; [$data]");
- $data = $evaled unless $@;
+ if (!$raw && defined($data)) {
+ if ($data ne '') {
+ my $evaled = eval("package $pkg; no warnings; no strict;
+ local \$SIG{__WARN__}=sub{die}; [$data]");
+ $data = $evaled unless $@;
+ }
+ else { $data = undef }
+ }
$pkg->$handler($sym,
(ref $sym eq 'GLOB' ? *{$sym}{ref $ref}||$ref : $ref),
$attr,