Re: Binding array to pattern



In <slrne937sq.3uc.tadmc@xxxxxxxxxxxxxxxxxxxx>, on 06/15/2006
at 12:57 PM, Tad McClellan <tadmc@xxxxxxxxxxxxxx> said:

You flipped the lines from what you posted before,

I edited the text of the article instead of clipping from my code, and
inadvertently left some out. That should be

my $email_contact = $email_info->{$_} ;
push @Contacts, @{$email_contact};
my $scalarContacts="@{$email_contact}";
push @abuseContacts, @{$email_contact}
if (/abuse/ or $scalarContacts =~ /abuse/);

if grep /abuse/, $_, @$emails;

How is that better than scanning the derived scalar? Although it might
be better to do

my $scalarContacts="$_ @$email_contact";
push @abuseContacts, @$email_contact
if $scalarContacts =~ /abuse/;

--
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 spamtrap@xxxxxxxxxxxxxxxxxx

.



Relevant Pages

  • Re: Binding array to pattern
    ... push @abuseContacts, @ ... and then put it on CPAN with a proper dependancy list. ... Then your instructions are of the form of 'install Net::WhoisAbuse from ...
    (comp.lang.perl.misc)
  • Re: Binding array to pattern
    ... push @abuseContacts, @ ... do write out the full whois records. ... Unsolicited bulk E-mail subject to legal action. ...
    (comp.lang.perl.misc)
  • Re: Binding array to pattern
    ... push @abuseContacts, @ ... the word "abuse" in the addresses or might have it only in the tags. ... When will Perl6 be ready for prime time? ...
    (comp.lang.perl.misc)
  • Re: Binding array to pattern
    ... factor that out into a scalar before the loop. ... push @abuseContacts, @; ... Applying both Uri's and my suggestions to that code yields: ...
    (comp.lang.perl.misc)
  • Re: Pure-cardinal approach *is* possible! (was: Mathematical concepts)
    ... Your alternative seems to be to push an entire ... >un-learn later?? ... Why do you beat your wife? ... Unsolicited bulk E-mail subject to legal action. ...
    (sci.math)

Loading