Re: Email Purge
- From: perl <tod@xxxxxxxxxx>
- Date: Wed, 25 Feb 2009 12:09:47 -0800 (PST)
Ok, thanks for the helpful responses. I modified the code with 2
different suggestions. I'm not using strict. Any more ideas?
With this code I get this error
Can't modify concatenation (.) or string in scalar assignment at
email.cgi line 535, near "<$list>;"
with this code: %emails = map { chomp; $_, 1 } <$list>;
And I get this error
Can't modify concatenation (.) or string in scalar assignment at
email.cgi line 534, near "1 if"
with this code: $emails{lc $_} = 1 if ! exists $emails{lc $_};
Here is the whole routine...
my $list2 = "$userpath/files/$list";
my %emails;
open(my $list, '<', $list2)
or error("Open failed $list2 $!");
while (<$list>) {
chomp if defined;
next if /^\s*$/;
# do a check here maybe and a "next" if not a valid email
address.
$emails{lc $_} = 1 if ! exists $emails{lc $_};
#%emails = map { chomp; $_, 1 } <$list>;
}
close($list) or warn $!;
.
- Follow-Ups:
- Re: Email Purge
- From: Jim Gibson
- Re: Email Purge
- References:
- Email Purge
- From: perl
- Re: Email Purge
- From: Tim Greer
- Re: Email Purge
- From: Gunnar Hjalmarsson
- Re: Email Purge
- From: Tim Greer
- Email Purge
- Prev by Date: Re: obtaining permission
- Next by Date: Re: Email Purge
- Previous by thread: Re: Email Purge
- Next by thread: Re: Email Purge
- Index(es):
Relevant Pages
|