[mdlug] [TECH SUPPORT] How to count perl NCSL

Michael Corral micorral at comcast.net
Mon Feb 25 19:26:15 EST 2008


2008-02-25, Monsieur Robert Meier a ecrit:
> How can one count the NCSL (non-comment source lines) in a perl script?

To count noncomment lines (including blank lines):

egrep -cv '^[[:space:]]*#' yourscript.pl

To count noncomment lines which are not blank:

egrep -cv '(^[[:space:]]*#|^[[:space:]]*$)' yourscript.pl

Michael



More information about the mdlug mailing list