home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / dns / ddt2.0 / cmd / hosts-count < prev    next >
Encoding:
Text File  |  1993-05-17  |  1.1 KB  |  34 lines

  1. #!/usr/local/bin/perl
  2. #
  3. #  hosts-count - prints the count of (different) hostnames contained in A RR's
  4. #              These names should be absolute (see expand)
  5. #
  6. #  Copyright (C) 1992, 1993 PUUG - Grupo Portugues de Utilizadores
  7. #                                  do Sistema UNIX
  8. #                1992, 1993 FCCN - Fundacao para o Desenvolvimento dos Meios 
  9. #                                  Nacionais de Calculo Cientifico 
  10. #
  11. #  Authors: Jorge Frazao de Oliveira <frazao@puug.pt>
  12. #           Artur Romao <artur@dns.pt>
  13. #
  14. #  This file is part of the DDT package, Version 2.0.
  15. #
  16. #  Permission to use, copy, modify, and distribute this software and its 
  17. #  documentation for any purpose and without any fee is hereby granted, 
  18. #  provided that the above copyright notice appear in all copies.  Neither 
  19. #  PUUG nor FCCN make any representations about the suitability of this
  20. #  software for any purpose.  It is provided "as is" without express or 
  21. #  implied warranty.
  22.  
  23.  
  24. while (<STDIN>) {
  25.     if (/\tA\t/) {
  26.             ($Name) = split(/\s+/, $_);
  27.     
  28.         $count++ if !$host{$Name}++;
  29.         }
  30. }
  31.  
  32. print $count;
  33.  
  34.