Here's something that might work for you, depending on how long the files
are:

open(I,"$ARGV[0]");

my @foo = <I>;

print scalar @foo;

handling it this way will also allow you to do matching on lines fairly
easily if thats something you like.
set $/ to something else if you dont want to discriminate on newlines but on
say, spaces or so.

Regards,

Jos Boumans

----- Original Message -----
From: "Susan Richter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 04, 2001 8:56 PM
Subject: Counting lines on a file


> Can someone tell me what command I can use to go to machines and count the
> lines on a certain file?  I have log files for every machines (20 all
> together).  Each log file has lines that would equate to the files that it
> found.  I need to know how many files are found on all the machines.  I am
> using Perl 5 on NT.
>
> Thank you.
>
> Sam
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>

Reply via email to