[Bio] / FigKernelPackages / Tracer.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Tracer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.52, Wed Jun 14 01:12:42 2006 UTC revision 1.53, Sun Jun 18 05:13:54 2006 UTC
# Line 1606  Line 1606 
1606    
1607  =head3 AddToListMap  =head3 AddToListMap
1608    
1609  C<< Tracer::AddToListMap(\%hash, $key, $value); >>  C<< Tracer::AddToListMap(\%hash, $key, $value1, $value2, ... valueN); >>
1610    
1611  Add a key-value pair to a hash of lists. If no value exists for the key, a singleton list  Add a key-value pair to a hash of lists. If no value exists for the key, a singleton list
1612  is created for the key. Otherwise, the new value is pushed onto the list.  is created for the key. Otherwise, the new value is pushed onto the list.
# Line 1621  Line 1621 
1621    
1622  Key for which the value is to be added.  Key for which the value is to be added.
1623    
1624  =item value  =item value1, value2, ... valueN
1625    
1626  Value to add to the key's value list.  List of values to add to the key's value list.
1627    
1628  =back  =back
1629    
# Line 1631  Line 1631 
1631    
1632  sub AddToListMap {  sub AddToListMap {
1633      # Get the parameters.      # Get the parameters.
1634      my ($hash, $key, $value) = @_;      my ($hash, $key, @values) = @_;
1635      # Process according to whether or not the key already has a value.      # Process according to whether or not the key already has a value.
1636      if (! exists $hash->{$key}) {      if (! exists $hash->{$key}) {
1637          $hash->{$key} = [$value];          $hash->{$key} = [@values];
1638      } else {      } else {
1639          push @{$hash->{$key}}, $value;          push @{$hash->{$key}}, @values;
1640      }      }
1641  }  }
1642    

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3