source: lab.git/misc/domains.pl

Last change on this file was dff3e87, checked in by mitty <mitty@…>, 12 years ago
  • benchmark for DNS resolver
  • get domain lists from mail.log

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@126 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

  • Property mode set to 100644
File size: 330 bytes
Line 
1#! /usr/bin/perl -w
2
3use strict;
4use warnings;
5
6my $domain = '\@(([-a-z0-9]+\.)*[a-z]+)';
7
8my $file = shift @ARGV;
9open FILE, $file;
10
11my $domains = {};
12while (my $line = <FILE>) {
13    if ($line =~ /$domain/oi) {
14        $domains->{$1}++;
15    }
16}
17
18foreach my $key (keys %$domains) {
19    print $key, "\t", $domains->{$key}, "\n";
20}
Note: See TracBrowser for help on using the repository browser.