| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  |  | 
| 2 |  |  |  |  |  |  | package Apache::ASP::CGI::Table; | 
| 3 |  |  |  |  |  |  |  | 
| 4 | 46 |  |  | 46 |  | 1716 | use Carp qw(confess); | 
|  | 46 |  |  |  |  | 101 |  | 
|  | 46 |  |  |  |  | 27883 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | =pod | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | =head1 NAME | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | Apache::ASP::CGI::Table | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | Layer for compatibility with Apache::Table objects | 
| 15 |  |  |  |  |  |  | while running in CGI or command line / test mode. | 
| 16 |  |  |  |  |  |  |  | 
| 17 |  |  |  |  |  |  | =cut | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | sub new { | 
| 20 | 263 |  |  | 263 | 0 | 453 | my $class = shift; | 
| 21 | 263 |  |  |  |  | 7285 | bless {}, $class; | 
| 22 |  |  |  |  |  |  | } | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | sub set { | 
| 25 | 367 |  |  | 367 | 0 | 3404 | my($self, $key, $value) = @_; | 
| 26 | 367 | 50 |  |  |  | 1040 | defined($key) || confess("no key to set value $value"); | 
| 27 | 367 |  |  |  |  | 1793 | $self->{$key} = $value; | 
| 28 |  |  |  |  |  |  | } | 
| 29 |  |  |  |  |  |  |  | 
| 30 | 3945 |  |  | 3945 | 0 | 15060 | sub get { shift()->{shift()}; } | 
| 31 | 0 |  |  | 0 | 0 | 0 | sub unset { delete shift()->{shift()} }; | 
| 32 | 0 |  |  | 0 | 0 | 0 | sub clear { %{shift()} = (); }; | 
|  | 0 |  |  |  |  | 0 |  | 
| 33 |  |  |  |  |  |  | sub add { | 
| 34 | 33 |  |  | 33 | 0 | 477 | my($self, $name, $value) = @_; | 
| 35 |  |  |  |  |  |  |  | 
| 36 | 33 |  |  |  |  | 73 | my $old_value = $self->{$name}; | 
| 37 | 33 | 100 |  |  |  | 156 | if(ref $old_value) { | 
|  |  | 100 |  |  |  |  |  | 
| 38 | 17 |  |  |  |  | 66 | push(@$old_value, $value); | 
| 39 |  |  |  |  |  |  | } elsif(defined $old_value) { | 
| 40 | 3 |  |  |  |  | 15 | $self->{$name} = [$old_value, $value]; | 
| 41 |  |  |  |  |  |  | } else { | 
| 42 | 13 |  |  |  |  | 75 | $self->{$name} = $value; | 
| 43 |  |  |  |  |  |  | } | 
| 44 |  |  |  |  |  |  | } | 
| 45 |  |  |  |  |  |  |  | 
| 46 | 0 |  |  | 0 | 0 |  | sub merge { die("merge not implemented"); } | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | 1; |