ACEEWSMKIIWSDJDWKDKEKSSAQWE
and want to extract lines with option 5-10 with output like
SMKII
The code isBut Gave error.What can be possible error?#!/usr/bin/perl use strict; use warnings; if ( $#ARGV < 2 ) { print "Usage: extract.pl firstLine lastLine filename\n"; exit 1; } my $start = $ARGV[0]; my $stop = $ARGV[1]; my $file = $ARGV[2]; open (FILE,$file) || die "Can't open file \"$file\".\n"; my $count=0; while () { $count++; if ( $count >= $start && $count <= $stop ) { print ; } } close(FILE);
In reply to print and extract the line by vis1982
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |