git.shiar.nl
/
perl
/
plp
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a089d5
)
undefined warnings while reading unknown headers
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 31 May 2008 20:35:54 +0000
(20:35 +0000)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 31 May 2008 21:23:25 +0000
(21:23 +0000)
Return undef for unaliased headers right away, instead of trying to find
$header{+undef}. Result is the same (the '' header never exists at this
point), but without the warning.
lib/PLP/Tie/Headers.pm
patch
|
blob
|
history
diff --git
a/lib/PLP/Tie/Headers.pm
b/lib/PLP/Tie/Headers.pm
index 8e023fb4fab45ce4cefb8ec8eee5dfac21b5e0ad..ea2f172e1ae90ddb6dfa77981ddd1f37bc31ce2f 100644
(file)
--- a/
lib/PLP/Tie/Headers.pm
+++ b/
lib/PLP/Tie/Headers.pm
@@
-39,7
+39,8
@@
sub FETCH {
$self->[2] = 0;
}
$key =~ tr/_/-/;
- return $self->[0]->{ $self->[1]->{lc $key} };
+ defined ($key = $self->[1]->{lc $key}) or return;
+ return $self->[0]->{$key};
}
sub STORE {