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

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`
  • Comment on Re^5: Perl project lines of code "analyzer"

Replies are listed 'Best First'.
Re^6: Perl project lines of code "analyzer"
by psychotic (Beadle) on Dec 05, 2005 at 01:46 UTC
    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.