Path: utzoo!attcan!uunet!decwrl!bacchus.pa.dec.com!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.lang.perl Subject: address sniffing hack Message-ID: Date: 26 Jul 90 22:34:07 GMT Sender: news@wrl.dec.com (News) Organization: DEC Western Research Lab Lines: 33 Knowing you folks, you'll probably come up with seventeen better ways to do this. And I'm sure Randall has a one-liner for it. But, meanwhile, feed your syslog into this script and see what you get. We use it for name server testing. You can also feed it news articles. #! /usr/local/bin/perl # sniff addresses out of an input text. # # original: vixie@decwrl, 21jul90 %addrs = (); while (<>) { while (/@\w+(\.\w+)+/) { $h = $&; $h =~ s/^@//; $h =~ tr/A-Z/a-z/; ## print "-> $h\n"; $addrs{$h} = ''; $_ = $'; } } while (($_) = each %addrs) { print "$_\n"; } exit 0; -- Paul Vixie DEC Western Research Lab Palo Alto, California ...!decwrl!vixie