in reply to @ARGV / Command Line Arguments
#!/usr/local/bin/perl -w use strict; my $params=@ARGV; my ($input,$output,$length); if($params < 3){ die "Not enough parameters"; }else{ ($input,$output,$length)= @ARGV; } open(INFILE,"$input")||die "Can't open $input: $!\n"; open(OUTFILE,">$output")||die "Can't open $output: $!\n"; my $count=1; while(<INFILE>){ chomp; if(/>/){ ++$count; } if(length($_) >= $length){ print "\>$count\n",$line,"\n\n"; print OUTFILE "\>$count\n",$line,"\n\n"; } } close INFILE; close OUTFILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: confused
by Biker (Priest) on May 15, 2002 at 15:20 UTC | |
|
Re: Re: confused
by davorg (Chancellor) on May 15, 2002 at 15:26 UTC |