1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: db_hash.coretag,v 1.5 2007-03-30 23:40:54 pajamian Exp $
10 UserTag db-hash Order table column key
11 UserTag db-hash PosNumber 3
12 UserTag db-hash addAttr
13 UserTag db-hash Version $Revision: 1.5 $
14 UserTag db-hash Routine <<EOR
16 my($table, $col, $key, $opt) = @_;
20 my $val = ::tag_data($table,$col,$key);
27 $ref = $Vend::Interpolate::ready_safe->reval($val);
33 return $val unless defined $opt->{value};
36 @extra = split /:+/, $rest;
37 my $final = pop @extra;
39 $out .= "Original key request: $rest\n";
40 $out .= "\nFinal key: $final\n";
42 $out .= "key --> $_\n";
45 return "BAD HASH: $out" if $opt->{show_error};
51 return join get_joiner($opt->{joiner}), sort keys %$curr;
53 elsif(! defined $opt->{value}) {
54 return $curr->{$final};
57 $curr->{$final} = $opt->{value};
58 tag_data($table, $col, $key, { value => uneval_it($ref) });
59 return $curr->{$final};