git://git.jankratochvil.net
/
MyWeb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
0eb3009
)
+&FETCH: Normalize the /_push$/ values to always: "ARRAY" eq ref($val)
author
short
<>
Wed, 21 Sep 2005 04:54:39 +0000
(
04:54
+0000)
committer
short
<>
Wed, 21 Sep 2005 04:54:39 +0000
(
04:54
+0000)
Hash/Push.pm
patch
|
blob
|
history
diff --git
a/Hash/Push.pm
b/Hash/Push.pm
index
4e01cba
..
fd5668f
100644
(file)
--- a/
Hash/Push.pm
+++ b/
Hash/Push.pm
@@
-38,4
+38,15
@@
my($this,$key,$value)=@_;
return $this->pass("STORE",$key,[@$val_orig,$value]);
}
+sub FETCH($$)
+{
+my($this,$key)=@_;
+
+ my $val=$this->pass("FETCH",$key);
+ return $val if $key!~/_push$/;
+ $val=[] if !defined $val;
+ $val=[$val] if "ARRAY" ne ref($val);
+ return $val;
+}
+
1;