S
Shmuel (Seymour J.) Metz
on 06/16/2006 said:These three lines are equivalent to
push @abuseContacts, @{$email_contact}
if grep /abuse/, $_, @{$email_contact};
Doesn't that have the problme you mention below?
You do realise this will push *all* of @{$email_contact} onto
@abuseContact, if *any* of them match?
Whoops! Thanks.
Perhaps
my $email_contact = $email_info->{$_} ;
push @Contacts, @$email_contact;
if (/abuse/) {
push @abuseContacts, @$email_contact;
} elsif (my @abuseSubset=grep /abuse/, @$email_contact) {
push @abuseContacts, @abuseSubset;
}
By 'abuse contacts' you mean 'email addresses matching /abuse/',
right?
I mean contacts designated for reporting abuse; looking for the string
"abuse" is just the best heuristic I could come up with.
[Side issue: are you sure you mean /abuse/ and not /^abuse\@/ ?]
Very :-(
...so you can read the tags and find the correct addr by hand?
Yes.
Do you want the whole whois reply, or just all the email addesses in
the reply?
The snippet of code in question is producing summary data; elsewhere I
do write out the full whois records.
Or have I misunderstood you?
There are some complications that you aren't aware of. There are cases
in my whois processing where I must recursively invoke whois;
$host_info{$host}{Email} may include contacts from multiple whois
records.
Err... not for a while . Perl5 will be the supported and developed
version of Perl for the forseeable future. Some features of Perl6
are available for Perl5 in the modules in the Perl6::* namespace;
any() is in Perl6::Junction (or, as Uri said, in
Quantum::Superpositions, though that's likely much slower); also in
List::MoreUtils, which is probably what I'd use if I needed it.
I expect others to be using this program; I don't want to include
obsolete copies of code from CPAN, but I also don't want to require
them to download additional modules. So far I've been sticking with
modules that are included in the OS/2 distribution. Would it be better
form to not use additional modules, to use them and document a
download as part of the installation process or to supply potentially
obsolete copies with my program?
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to (e-mail address removed)