bdawg613 has asked for the wisdom of the Perl Monks concerning the following question:
#open the 2 files for input and the second for output open (FIN, "@ARGV[0]") || (die "No input file"); while(<FIN>){ if(s#((\b\w*\b\s)(\b\w*\b\s)?(\b\w*\b\s)(\<)(\b\w*((\.)?(\w*)? +)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\>))# $1 .($var =$2.$3.$4."\t".$6) #eg +){} elsif(s#((\b\w*\b)(\,\s)(\b\w*\b\s)(\b\w*\b\s)?((\<)(\b\w*((\. +)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\>)))# $1.($var = $4.$5.$2."\t +".$8) #eg){} elsif(s#((\")(\b\w*\b\s)(\b\w*\b\s)?(\b\w*\b)(\")(\s)(\<)(\b\w +*((\.)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\>))# $1.($var =$3.$4.$5. +"\t".$9) #eg){} elsif(s#((\")(\b\w*\b)(\,\s)(\b\w*\b)(\s\b\w*\b)?(\")(\s)((\<) +(\b\w*((\.)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\>)))# $1.($var = $5 +." ".$6.$3."\t".$11) #eg){} elsif(s#((\")(\b\w*\b\s)(\b\w*\b\s)?(\b\w*\b)(\")(\s)(\[)(\b\w +*((\.)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\]))# $1.($var =$3.$4.$5. +"\t".$9) #eg){} elsif(s#((\")(\b\w*\b)(\,\s)(\b\w*\b)(\s\b\w*\b)?(\")(\s)((\[) +(\b\w*((\.)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\])))# $1.($var = $5 +." ".$6.$3."\t".$11) #eg){} elsif(s#((\")(\b\w*\b\s)(\b\w*\b\s)?(\b\w*\b\s)(\[)(\b\w*((\.) +?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\])(\"))# $1.($var =$3.$4.$5."\ +t".$7) #eg){} elsif(s#((\")(\b\w*\b)(\,\s)(\b\w*\b)(\s\b\w*\b)?(\s)((\[)(\b\ +w*((\.)?(\w*)?)*[@]\w*\.\w*((\.)?(\w*)?)*\b)(\])(\")))# $1.($var = $5 +." ".$6.$3."\t".$10) #eg){} #hash my emails $hashed{$var}++; } #print out all the emails for $var (sort keys %hashed){ print"$var\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: finding emails
by tachyon (Chancellor) on Nov 11, 2002 at 23:08 UTC | |
|
Re: finding emails
by IlyaM (Parson) on Nov 11, 2002 at 23:23 UTC | |
|
Re: finding emails
by Enlil (Parson) on Nov 11, 2002 at 22:57 UTC | |
|
Re: finding emails
by rbc (Curate) on Nov 11, 2002 at 23:26 UTC |