less ~/.vim/headers/pl
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
my ($output_dir,$number,$input_dir);
&Usage("Too few arguments") if $#ARGV<0;
GetOptions(
'o|out_dir=s' => \$output_dir,
'i|input_dir=s' => \$input_dir,
'n|number=i' => \$number
)or &Usage("Wrong arguments");
&process();
sub process(){
foreach my $file (glob("*.")){
open(IN,"$file")or die $!;
while(<IN>){
chomp;
my @line = split(/\t/,$_);
print "$line[1]\n";
die;
}
}
}
sub Usage(){
my($msg) = @_;
print "\nUsage: perl script.pl -o out_dir/ -i input_dir/ -n 1
$msg!
Argument(s):
-out_dir|-o
-number|-n
-input_dir|-i\n";
exit(1);
}
0 comentários:
Post a Comment