source:
lab.git/misc/domains.pl
@
6473c3b
Last change on this file since 6473c3b was dff3e87, checked in by mitty <mitty@…>, 13 years ago | |
---|---|
|
|
File size: 330 bytes |
Line | |
---|---|
1 | #! /usr/bin/perl -w |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | my $domain = '\@(([-a-z0-9]+\.)*[a-z]+)'; |
7 | |
8 | my $file = shift @ARGV; |
9 | open FILE, $file; |
10 | |
11 | my $domains = {}; |
12 | while (my $line = <FILE>) { |
13 | if ($line =~ /$domain/oi) { |
14 | $domains->{$1}++; |
15 | } |
16 | } |
17 | |
18 | foreach my $key (keys %$domains) { |
19 | print $key, "\t", $domains->{$key}, "\n"; |
20 | } |
Note: See TracBrowser
for help on using the repository browser.