Quoth "Shmuel (Seymour J.) Metz said:
Whoops! I edited the text from the article instead of doing a cut-and-paste directly from my code. Make that
my $email_contact = $email_info->{$_} ;
push @Contacts, @{$email_contact};
my $scalarContacts="@{$email_contact}";
push @abuseContacts, @{$email_contact}
if (/abuse/ or $scalarContacts =~ /abuse/);
These three lines are equivalent to
push @abuseContacts, @{$email_contact}
if grep /abuse/, $_, @{$email_contact};
except that doesn't waste time (both for the machine and the human reading the code) stringifying the array; and there aren't problems with
$email_contact = ['fooab', 'use this'];
(though I suspect this isn't an issue in your case).
You do realise this will push *all* of @{$email_contact} onto @abuseContact, if *any* of them match? From your description below I can't quite see how this could be what you want.
I'm extracting e-mail contacts from whois data. In some cases there are multiple contacts for the same role. The abuse contacts might have the word "abuse" in the addresses or might have it only in the tags. If there are abuse contacts then I want to put them in a message;
By 'abuse contacts' you mean 'email addresses matching /abuse/', right? [Side issue: are you sure you mean /abuse/ and not /^abuse\@/ ?]
otherwise want to put all of the e-mail in a different message.
....so you can read the tags and find the correct addr by hand? Do you want the whole whois reply, or just all the email addesses in the reply?
In any case, I'd do something like (untested)
my @abuse_addrs;
my @misc_addrs;
my @domains = ...;
for (@domains) {
my $whois = get_whois_data($_);
my @emails = extract_email_addrs($whois);
my @ae = grep /abuse/, @emails;
if (@ae) {
push @abuse_addrs, @ae;
}
else {
push @misc_addrs, $whois; # or @emails
}
}
Or have I misunderstood you?
When will Perl6 be ready for prime time?
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.
Ben