X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bp_bin%2Fread_mysql;h=2d8f7b1674c3704cb2bb554554fb703a70505a8a;hb=af282a65d141826c15944437b07a0353dd14e79c;hp=b79458bcf200cbf7462f40b96dfa8d6e164df977;hpb=b607bb9d6e4adcebd9f9e128aacc91a212010ee0;p=biopieces.git diff --git a/bp_bin/read_mysql b/bp_bin/read_mysql index b79458b..2d8f7b1 100755 --- a/bp_bin/read_mysql +++ b/bp_bin/read_mysql @@ -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::SQL; @@ -35,17 +36,17 @@ use Maasha::UCSC; # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -my ( $default_user, $default_password, $options, $in, $out, $record, $dbh, $results ); +my ( $user, $password, $options, $in, $out, $record, $dbh, $results ); -$default_user = Maasha::UCSC::ucsc_get_user(); -$default_password = Maasha::UCSC::ucsc_get_password(); +$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 => 'query', short => 'q', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef }, - { long => 'user', short => 'u', type => 'string', mandatory => 'no', default => $default_user, allowed => undef, disallowed => undef }, - { long => 'password', short => 'p', type => 'string', mandatory => 'no', default => $default_password, allowed => undef, disallowed => undef }, + { long => 'database', short => 'd', type => 'string', mandatory => 'yes', default => undef, allowed => undef, disallowed => undef }, + { long => 'query', short => 'q', type => 'string', mandatory => 'yes', 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 }, ] ); @@ -64,25 +65,22 @@ Maasha::SQL::disconnect( $dbh ); map { Maasha::Biopieces::put_record( $_ ) } @{ $results }; +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(); }