[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Counting the number of lines in a document



In Regards to your letter <199604241556.RAA13758@yggdrasil.ethz.ch>:
>  If you need to perform other operations on the file, it's probably
>  easiest to use the value of $. after processing the file. Otherwise,
>  do something like:
> 
>  undef $/;
> 
>  $f = <>;
> 
>  $count = ($f =~ tr/\n//);

Or:

@f = <>;
$count = $#f + 1;


tim.

time@ice.com  (UUCP: heifetz!tbomb!time)

USENET - a slow moving self parody... ph