5 # -----------------------------------------------------------------------------
11 # Search for *.[H] files with 'Class' starting in the first column
12 # and a missing Description, or a tiny Description.
13 # A tiny Description is less than XX letters and does not resemble
14 # the class name. We'll look for descriptions matching the class name
17 # - print filename '#' and the description
19 # -----------------------------------------------------------------------------
22 my $re_filespec = qr{^.+\.[H]$};
24 # for the convenience of &wanted calls, including -eval statements:
25 ## use vars qw( *name *dir *prune );
26 ## *name = *File::Find::name;
27 ## *dir = *File::Find::dir;
28 ## *prune = *File::Find::prune;
31 unless ( lstat($_) and -f _
and -r _
and not -l _
and /$re_filespec/ ) {
35 my ( $currentClass, $description );
41 ## examine the class name
44 ($currentClass) = split;
46 if (/^Description\s*$/) {
48 ( $description = $_ ) =~ s{^\s+|\s+$}{}g;
50 # remove trailing punctuation as being noise
51 $description =~ s{\s*[.,:]+$}{};
58 ## we have 'Class' tag
59 if ( defined $currentClass ) {
60 # description doesnt looks like a class name
62 $description !~ m{^\w+(::\w+)+$}
64 (length $description < $minLength or $description =~ m{^\S+$})
66 print "$File::Find::name # $description\n";
71 ## Traverse desired filesystems
73 no warnings
'File::Find';
74 warn "(**) checking '$dir' ...\n";
75 File
::Find
::find
( { wanted
=> \
&wanted
}, $dir );