#!/usr/bin/perl -w
use strict;
use Getopt::Long qw(:config no_ignore_case); # use GetOption function
use Term::ANSIColor;
# mysql config
my $output_path = `pwd`;
chomp($output_path);
my $dbstr;
my $srcfile='';
# log file
my $logfile;
# ----------------------------------------------------
# handle Ctrl+C
sub catch_zap {
my $signame = shift;
print "\nExit Now...\n\n";
exit;
}
$SIG{INT} = \&catch_zap;
# ----------------------------------------------------------------------------------------
# Main()
# ----------------------------------------------------------------------------------------
sub main{
# get input params
&get_option();
&do_fetch();
}
&main();
# ----------------------------------------------------------------------------------------
# Func : get input params
# http://perldoc.perl.org/Getopt/Long.html#Command-Line-Options%2c-an-Introduction
# ----------------------------------------------------------------------------------------
sub get_option{
GetOptions('h|help'=> \&help_print,
's|srcfile=s' => \$s