- or download this
open (IN, "<", $ARGV[0]);
my $i =0;
while (<IN>){$i++}
print $i;
- or download this
perl -e 'open(IN,"<", $ARGV[0]);$i=0;while(<IN>){$i++};print $i' in.fi
+le
- or download this
perl -ne '$i++; print $i' in.file
- or download this
perl -ne '$i++; print $i' in.file