in reply to Re^3: Perl project lines of code "analyzer"
in thread Perl project lines of code "analyzer"

Excellent! Nice doing business with you, sir. I initially figured that "parsing" POD would clutter things up significantly, but apparently that stemmed from my partial misunderstanding of the it's nature. Thanks for not only clearing that up, but also coming up with a solution.

I noticed you prefered the obvious '.' instead of cwd(). Is there a specific reason for doing so? I tend to do that myself when writing up something in a hurry, but i always thought cwd() as being the "proper" way. Anyhow, that isn't related to the current thread.

Replies are listed 'Best First'.
Re^5: Perl project lines of code "analyzer"
by jdhedden (Deacon) on Dec 01, 2005 at 16:59 UTC
    cwd() caused the lines to get too long and wrap on my terminal. Besides, I already knows the path to '.' from my shell prompt. If I need the full path, I can always invoke it with: sloc `pwd`
      I guess your signature is correct. ;) While adding POD comments support in my code (see the updated work) i noticed that there was a slight oversight in the POD conditionals. Examine for instance this snippet:
      use strict; use warnings; # Trap armed my $trap = "Trapped!"; # Does it work? (Yes, it does.) print $trap;
      With the oversight i mentioned, your code, erroneously, gives:
      Code Cmts POD Total File ============================================================ 3 1 4 8 ./test.pl ============================================================ 3 1 4 8 -- Summary of all files
        Hmmm... While you're technically correct, I would view anyone who wrote code like that to be... well, psychotic. ;-)

        At any rate, here's the fix. Replace:

        # Count POD if ($line =~ /^=/) { pod++;
        with
        # Count POD if ($line =~ /^=[a-z]/) { $pod++;

        Remember: There's always one more bug.