umans
- Original Message -
From: "Jeff Pinyan" <[EMAIL PROTECTED]>
To: "Jos I Boumans" <[EMAIL PROTECTED]>
Cc: "Susan Richter" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, May 05, 2001 5:05 PM
Subject: Re: Counting lines on a
On Sat, May 05, 2001 at 12:12:08AM -0400, Jeff Pinyan wrote:
: On May 4, Brett W. McCoy said:
:
: >On Fri, 4 May 2001, Susan Richter wrote:
: >
: >> 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 al
On May 5, Jos I Boumans said:
>open(I,"$ARGV[0]");
>my @foo = ;
>print scalar @foo;
It is considered a dubious practice to read a file into an array; this can
use of lots of memory. It is particularly wasteful if the goal is just to
find out how many lines there are.
Another wasteful use is:
On Sat, 5 May 2001, Paul wrote:
>
> --- Mike Lacey <[EMAIL PROTECTED]> wrote:
> > my $file = $ARGV(0);
>
> carefull there -- $ARGV(0) will probably err.
>^ ^
> use $ARGV[0] instead.
That's what I meant, as I had posted in a followup message.
-- Brett
--- Mike Lacey <[EMAIL PROTECTED]> wrote:
> my $file = $ARGV(0);
carefull there -- $ARGV(0) will probably err.
^ ^
use $ARGV[0] instead.
^ ^
__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great price
Here's something that might work for you, depending on how long the files
are:
open(I,"$ARGV[0]");
my @foo = ;
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 discriminat
On May 4, Brett W. McCoy said:
>On Fri, 4 May 2001, Susan Richter wrote:
>
>> 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 t
On Sat, 5 May 2001, Mike Lacey wrote:
> my $file = $ARGV(0);
Oops, that should be $ARGV[0];
-- Brett
http://www.chapelperilous.net/btfwk/
Men often believe -- or pretend -- that the "Law"
my $file = $ARGV(0);
hmmm -- try
my $file = shift;
- Original Message -
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "Susan Richter" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, May 05, 2001 1:26 AM
Subject: Re: Counting lines o
> >Can someone tell me what command I
> >can use to go to machines and count the
> >lines on a certain file?
perl -ne '/\n/ and $i++; eof and print $i'
where isn't really in <>s.
(Btw, be wary of using eof().
Otoh, sometimes it's just what you want.)
On Fri, 4 May 2001, Susan Richter wrote:
> 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 m
On May 4, Susan Richter said:
>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 ar
12 matches
Mail list logo