§%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
== comment.file-description-pl == start ==
#!/usr/bin/perl
#==============================================================================#
#-------------------------------help-info-start--------------------------------#
=head1 Name
|FILENAME| --> <CURSOR>
=head1 Usage
perl |FILENAME| [options] <input file>
-help ( tag) print this help to screen
-log ( str) write log to a file
-o ( str) write result to a file
=head1 Example
perl |FILENAME| input_file
perl |FILENAME| ---
=head1 Version
Verion : 1.0
Created : |DATE| |TIME|
Updated : ---
LastMod : ---
=head1 Contact
Author : QuNengrong (Qunero)
E-mail : Quner612@qq.com,QuNengrong@genomics.cn
Company : BGI
=cut
#-------------------------------help-info-end--------------------------------#
#============================================================================#
use strict;
use warnings;
use Getopt::Long;
my ($Need_help, $Log_file, $Out_file );
GetOptions(
"help" => \$Need_help,
"log=s" => \$Log_file,
"o=s" => \$Out_file,
);
die `pod2text $0` if ($Need_help);
#============================================================================#
# Global Variable #
#============================================================================#
my $Input_file = $ARGV[0] if (exists $ARGV[0]);
#============================================================================#
# Main process #
#============================================================================#
if(defined $Input_file)
{ open(STDIN, '<', $Input_file) or die $!; }
if(defined $Log_file)
{ open(STDERR, '>', $Log_file) or die $!; }
if(defined $Out_file)
{ open(STDOUT, '>', $Out_file) or die $!; }
print STDERR '---Program starts --> '.localtime()."\n";
my @line2arr;
while(<STDIN>){
chomp;
next if(m/^$/);
@line2arr = split /\t+/;
print STDOUT $_."\n";
}
print STDERR '---Program ends --> '.localtime()."\n";
#============================================================================#
# Subroutines #
#============================================================================#
if(defined $Input_file){
print STDERR "Start\treading input file $Input_file".' --> '.localtime()."\n";
}
if(defined $Input_file){
print STDERR "finish\treading input file $Input_file".' --> '.localtime()."\n";
}
评论