Subject: | undefined value breakage |
Hi Smylers,
The attribute_list() method is intended to work even when no value has been defined for a given key. In that case it tries to dereference an 'undef', which won't work. There's a "no warnings" thing to guard it, but that doesn't work because it's a strictness issue.
I've attached an obvious patch to fix it. Not properly tested or anything.
Hilariously, the project for which this module was originally written can't use it without this patch.
qef
--- lib/Class/FakeAttributes.pm Thu Oct 30 00:00:40 2003
+++ lib/Class/FakeAttributes.pm Tue Aug 17 14:12:56 2004
@@ -135,7 +135,7 @@
# If $self doesn't have any attributes then don't complain, just return an
# empty list (same as if it has some attributes but just not any with key
# $key):
- no warnings 'uninitialized';
+ return unless defined $attribute{$self}{$key};
@{$attribute{$self}{$key}};
}