]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/remove_mysql_tables
refactoring of assemble_pairs
[biopieces.git] / bp_bin / remove_mysql_tables
index 28751697a5cb66b4b4fa7e48d3cadc3ddba9bf99..794ab0f9c36db3248f6da0414c68eefec04c2a41 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
 
 # Copyright (C) 2007-2009 Martin A. Hansen.
 
@@ -26,6 +26,7 @@
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Maasha::Biopieces;
 use Maasha::Common;
@@ -36,15 +37,18 @@ use Maasha::UCSC;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
-my ( $options, $in, $out, $record, %table_hash, $dbh, $table );
+my ( $options, $user, $password, $in, $out, $record, %table_hash, $dbh, $table );
+
+$user     = Maasha::Biopieces::biopiecesrc( "MYSQL_USER" );
+$password = Maasha::Biopieces::biopiecesrc( "MYSQL_PASSWORD" );
 
 $options = Maasha::Biopieces::parse_options(
     [
-        { long => 'database', short => 'd', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef },
-        { long => 'tables',   short => 't', type => 'list',   mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
-        { long => 'keys',     short => 'k', type => 'list',   mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
-        { long => 'user',     short => 'u', type => 'string', mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
-        { long => 'password', short => 'p', type => 'string', mandatory => 'no',  default => undef, allowed => undef, disallowed => undef },
+        { long => 'database', short => 'd', type => 'string', mandatory => 'yes', default => undef,     allowed => undef, disallowed => undef },
+        { long => 'tables',   short => 't', type => 'list',   mandatory => 'no',  default => undef,     allowed => undef, disallowed => undef },
+        { long => 'keys',     short => 'k', type => 'list',   mandatory => 'no',  default => undef,     allowed => undef, disallowed => undef },
+        { long => 'user',     short => 'u', type => 'string', mandatory => 'no',  default => $user,     allowed => undef, disallowed => undef },
+        { long => 'password', short => 'p', type => 'string', mandatory => 'no',  default => $password, allowed => undef, disallowed => undef },
     ]   
 );
 
@@ -84,26 +88,22 @@ foreach $table ( sort keys %table_hash )
 
 Maasha::SQL::disconnect( $dbh );
 
+Maasha::Biopieces::close_stream( $in );
+Maasha::Biopieces::close_stream( $out );
+
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
 BEGIN
 {
-    $run_time_beg = Maasha::Biopieces::run_time();
-
-    Maasha::Biopieces::log_biopiece();
+    Maasha::Biopieces::status_set();
 }
 
 
 END
 {
-    Maasha::Biopieces::close_stream( $in );
-    Maasha::Biopieces::close_stream( $out );
-
-    $run_time_end = Maasha::Biopieces::run_time();
-
-    Maasha::Biopieces::run_time_print( $run_time_beg, $run_time_end, $options );
+    Maasha::Biopieces::status_log();
 }
 
 
@@ -111,4 +111,3 @@ END
 
 
 __END__
-