- or download this
LINE:
while (<>) {
... # your program goes here
}
- or download this
LINE: while (defined($_ = <ARGV>)) {
$first ||= $_;
...
die "ERROR found $count lines. Need >5" unless $count > 5;
print "FIRST:$first\nLAST:$last\n";
}
- or download this
perl -ne '$first ||=$_; $last=$_; $count++}{die qq(ERROR found $count
+lines. Need >5) unless $count>5; print qq(FIRST:$first\nLAST:$last\n)
+' YOUR-FILE-NAME-here.txt