2011-02-03 13:47:29 +01:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
2011-02-03 14:18:19 +01:00
|
|
|
# This script displays the number of lines in a file
|
|
|
|
|
2011-02-03 13:47:29 +01:00
|
|
|
use strict;
|
|
|
|
|
|
|
|
die "un argument svp ! " if !defined ($ARGV[0]);
|
|
|
|
|
|
|
|
my $i=0;
|
|
|
|
open(P,"< $ARGV[0]") || die "erreur ouverture $!";
|
|
|
|
|
|
|
|
while (<P>)
|
|
|
|
{
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
close(P);
|
|
|
|
print "nb de lignes = $i \n";
|