I guess I get first crack.

> What should be done to write  PERL script which counts the number of lines
> of code in a file?

The easiest way (perhaps not the most efficient) is to read in the
contents of the file into an array and reference the array as a scalar:

open F,'file';
my @data=<F>;
close F;
print "file contains ".@data." lines";


PS Let it be noded that there are two Benjamin Bradleys on this list, of
which I am the more knowledgable.

- Benjamin Bradley - "these strange things happen all the time"
- http://lostpoet.tripod.com/
- whee life what a rush

---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]

Reply via email to