http://qs321.pair.com?node_id=77255


in reply to Re: Line-counts of perl programs/modules
in thread Line-counts of perl programs/modules

Why are you counting your close curly braces? Wouldn't it be better to just count the ';'s? If you are like me and comment a lot (even comment out lines of code for later use) you might want to grep out the '#'s too then count the ';'s.

I still can't think of why you would count the close curlies though.

egrep -v '^#' file | egrep -e ';$' | wc -l

----------
- Jim

Replies are listed 'Best First'.
Re: Re: Re: Line-counts of perl programs/modules
by Tarka (Novice) on May 07, 2001 at 03:05 UTC
    I count the braces so that conditionals and loops count as a line apeice. Admittedly that pulls in subs too (and anonymous hashes, if their closing brace doesn't end on the same line as the semi). It's just a personal preference.