[Bio] / FortyEightMeta / TaxStr.pm Repository:
ViewVC logotype

Diff of /FortyEightMeta/TaxStr.pm

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

revision 1.1, Fri Mar 28 20:20:09 2008 UTC revision 1.2, Fri May 30 23:23:51 2008 UTC
# Line 1  Line 1 
1  package TaxStr;  package FortyEightMeta::TaxStr;
2    
3  #  #
4  # Simple module to wrap up the tax string manipulation routines.  # Simple module to wrap up the tax string manipulation routines.
# Line 13  Line 13 
13    
14  our $DIGITS;  our $DIGITS;
15  BEGIN {  BEGIN {
16      $DIGITS = [map { chr($_) } 33..47, 48..57, 59..64, 65..90, 91..96, 97..122, 123..126];      $DIGITS = [map { chr($_) } 33..47, 48..57, 59..64, 65..90, 91, 93..96, 97..122, 123..126];
17  }  }
18    
19  sub new  sub new
# Line 32  Line 32 
32      return bless $self, $class;      return bless $self, $class;
33  }  }
34    
35    sub DESTROY
36    {
37        my($self) = @_;
38        $self->taxstr_lookup()->finish();
39        $self->taxstr_insert()->finish();
40        $self->taxstr_update()->finish();
41    }
42    
43  sub tax_name_to_id  sub tax_name_to_id
44  {  {
# Line 44  Line 51 
51      if ($res)      if ($res)
52      {      {
53          my $k = $res->[0];          my $k = $res->[0];
54            $k =~ s/\s+$//;
55          $self->cache->{$str} = ['F', $k];          $self->cache->{$str} = ['F', $k];
56  #       print "F\t'$str'\t'$k'\n";  #       print "F\t'$str'\t'$k'\n";
57          return $k;          return $k;
# Line 57  Line 65 
65          }          }
66          $self->taxstr_insert->execute($str);          $self->taxstr_insert->execute($str);
67    
68          my $id = $self->dbh->{mysql_insertid};          #my $id = $self->dbh->{mysql_insertid};
69            my $id = $self->dbh->last_insert_id(undef, undef, 'tax_item', undef);
70          my $s = $self->calc->to_base($id);          my $s = $self->calc->to_base($id);
71          $self->taxstr_update->execute($s, $id);          $self->taxstr_update->execute($s, $id);
72  #       print "N\t$str\t$id\t$s\n";  #       print "N\t$str\t$id\t$s\n";

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3