some-usable-scripts/PERL_Language/wc.pl
2011-02-20 18:52:23 +01:00

18 lines
261 B
Perl
Executable File

#!/usr/bin/perl -w
# This script displays the number of lines in a file
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";