in reply to Re: Perl LOC counter?
in thread Perl LOC counter?

Very interesting. I ran this on some test code and the results are very different from SLOCCount (see above). They're around twice as high for the count of lines of code. My guess is that it has something to do with how you're counting POD lines. SLOCCount just stops counting lines of code when it sees /^=\w/ and starts again when it sees /^=cut/. Your method seems more sophisticated, but I wonder if it's correct. I plan to investigate more closely to figure out which one is right.

-sam

Replies are listed 'Best First'.
Re: Re: Re: Perl LOC counter?
by jplindstrom (Monsignor) on May 16, 2003 at 22:51 UTC
    Well, looking at my code I see that

    $noLineCode += scalar(grep { $_ =~ /\w/ } @aLine);

    will include POD as well, so... it actually measures "code" as opposed to "whitespace", not "code" as opposed to "non-code". Eh, so to speak :)

    It depends on what you want to measure and what you think the metric says about the source.

    /J