home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / perl / scripts-convex / man.shar / man / countman < prev    next >
Encoding:
Text File  |  1991-03-04  |  326 b   |  12 lines

  1. #!/usr/local/bin/perl
  2. #
  3. # countman -- count the number of entries in a man tree
  4.  
  5. $|  = 1;
  6. for (split(/:/, shift || $ENV{'MANPATH'} || '/usr/man')) {
  7.     dbmopen(%whatis, "$_/whatis", undef) || (warn "$0: dbmopen $_: $!\n",next);
  8.     print $_, ': ';
  9.     for ($count = 0; each %whatis; $count++) { } 
  10.     print $count, "\n";
  11.