Multi-Graphics wrote: > how can i count the numbers of lines text of a log file
Try
$lines = 0;
open(FILE, 'file') or die $!;
$lines++ while <FILE>;
close(FILE);
> and how do i show the number
To print the number of lines to STDOUT:
print "Number of lines: $lines\n";
> and how can i print for example line 5 to 15
open(FILE, 'file') or die $!;
print ((<FILE>)[4..14]); # inefficient, but
# easy to write
close(FILE);
Regards,
David
> thanks
>
>
