I have the following script that prints email addresses enclosed in <>
from a logfile. It works by removing everything up to and including the
bracket on the left, and then doing the same on the right. I would like
to be able to just extract the text between the brackets.
I have been unable to figure out how to do this and am hoping for some
help.
===============================
#!/usr/local/bin/perl -w
# Read through the maillog, and print out the email
# addresses. (<email.address>)
open (INFILE, "<$ARGV[0]" );
while (<INFILE>) {
if( $_ =~ /<.*>/i ) {
$_ =~ s/^.*<//g;
$_ =~ s/>.*$//g;
print $_;
}
}
close INFILE;
--charlie
--
------------------------------------------------------------------------
Charlie Farinella, Appropriate Solutions, Inc.
[EMAIL PROTECTED]
603-924-6079
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]