[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.73, Tue Oct 3 12:04:50 2006 UTC revision 1.74, Thu Oct 5 21:51:09 2006 UTC
# Line 34  Line 34 
34      use LWP::UserAgent;      use LWP::UserAgent;
35      use Time::HiRes 'gettimeofday';      use Time::HiRes 'gettimeofday';
36      use URI::Escape;      use URI::Escape;
37        use Time::Local;
38    
39  =head1 Tracing and Debugging Helpers  =head1 Tracing and Debugging Helpers
40    
# Line 931  Line 932 
932      return $value;      return $value;
933  }  }
934    
935    =head3 ParseTraceDate
936    
937    C<< my $time = Tracer::ParseTraceDate($dateString); >>
938    
939    Convert a date from the trace file into a PERL timestamp.
940    
941    =over 4
942    
943    =item dateString
944    
945    The date string from the trace file. The format of the string is determined by the
946    L</Now> method.
947    
948    =item RETURN
949    
950    Returns a PERL time, that is, a number of seconds since the epoch, or C<undef> if
951    the time string is invalid.
952    
953    =cut
954    
955    sub ParseTraceDate {
956        # Get the parameters.
957        my ($dateString) = @_;
958        # Declare the return variable.
959        my $retVal;
960        # Parse the date.
961        if ($dateString =~ m#(\d+)/(\d+)/(\d+)\s+(\d+):(\d+):(\d+)#) {
962            # Create a time object.
963            $retVal = timelocal($6, $5, $4, $3, $2, $1);
964        }
965        # Return the result.
966        return $retVal;
967    }
968    
969  =head3 LogErrors  =head3 LogErrors
970    
971  C<< Tracer::LogErrors($fileName); >>  C<< Tracer::LogErrors($fileName); >>

Legend:
Removed from v.1.73  
changed lines
  Added in v.1.74

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3