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

Diff of /FigKernelPackages/FIG.pm

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

revision 1.363, Thu Sep 8 16:12:22 2005 UTC revision 1.364, Fri Sep 9 13:28:58 2005 UTC
# Line 2601  Line 2601 
2601  #  #
2602  #=cut  #=cut
2603  #  #
2604  sub N2file :Scalar {  sub N2file :Scalar
2605    {
2606      my($self,$fileno) = @_;      my($self,$fileno) = @_;
2607      my($relational_db_response);  
2608        #
2609        # Cache outputs. This results in a huge savings of time when files are
2610        # accessed multiple times (as in when a bunch of sims are requested).
2611        #
2612    
2613    
2614        my $fcache = $self->cached("_n2file");
2615    
2616        my $fname;
2617        if (defined($fname = $fcache->{$fileno}))
2618        {
2619            return $fname;
2620        }
2621    
2622      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
2623    
2624      if (($relational_db_response = $rdbH->SQL("SELECT file FROM file_table WHERE ( fileno = $fileno )")) &&      my $relational_db_response = $rdbH->SQL("SELECT file FROM file_table WHERE ( fileno = $fileno )");
2625          (@$relational_db_response == 1)) {  
2626          return $relational_db_response->[0]->[0];      if ($relational_db_response and @$relational_db_response == 1)
2627        {
2628            $fname = $relational_db_response->[0]->[0];
2629            $fcache->{$fileno} = $fname;
2630            return $fname;
2631      }      }
2632      return undef;      return undef;
2633  }  }

Legend:
Removed from v.1.363  
changed lines
  Added in v.1.364

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3