From 7e8d72acd946f771903fa8d97071a2393e9a01c6 Mon Sep 17 00:00:00 2001
From: martinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Date: Tue, 23 Sep 2008 06:45:50 +0000
Subject: [PATCH] fixed STDERR and verbose

git-svn-id: http://biopieces.googlecode.com/svn/trunk@266 74ccb610-7750-0410-82ae-013aeee3265d
---
 code_perl/Maasha/Biopieces.pm | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm
index 6bf84e2..b910f9a 100644
--- a/code_perl/Maasha/Biopieces.pm
+++ b/code_perl/Maasha/Biopieces.pm
@@ -110,14 +110,8 @@ close $log_local;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> RUN SCRIPT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my $t0 = gettimeofday();
-
 run_script( $script );
 
-my $t1 = gettimeofday();
-
-print STDERR "Program: $script" . ( " " x ( 25 - length( $script ) ) ) . sprintf( "Run time: %.4f\n", ( $t1 - $t0 ) );
-
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SUBROUTINES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
@@ -158,7 +152,9 @@ sub run_script
 
     # Returns nothing.
 
-    my ( $options, $in, $out );
+    my ( $t0, $t1, $options, $in, $out );
+
+    $t0 = gettimeofday();
 
     $options = get_options( $script );
 
@@ -267,6 +263,10 @@ sub run_script
 
     close $in if defined $in;
     close $out;
+
+    $t1 = gettimeofday();
+
+    print STDERR "Program: $script" . ( " " x ( 25 - length( $script ) ) ) . sprintf( "Run time: %.4f\n", ( $t1 - $t0 ) ) if $options->{ 'verbose' };
 }
 
 
-- 
2.39.5