Re: Email Purge



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 $!;
.



Relevant Pages

  • Email Purge Again
    ... Can't modify concatenation or string in scalar assignment at ... or error("Open failed $list2 $!"); ...
    (comp.lang.perl.misc)
  • Re: Email Purge
    ... Can't modify concatenation or string in scalar assignment at ... or error("Open failed $list2 $!"); ... # do a check here maybe and a "next" if not a valid email ...
    (comp.lang.perl.misc)
  • Re: Drag and Drop, then Email
    ... You can refer to the email field via the Column property of the listbox. ... box with the emails of the people in List2. ... > If I can string together the emails in List2, ...
    (microsoft.public.access.formscoding)
  • Drag and Drop, then Email
    ... I have a drag and drop interface so that the user can select one or more ... Once the user drags some or all names from List1 to List2, ... If I can string together the emails in List2, and then copy this text string ...
    (microsoft.public.access.formscoding)
  • Re: code to check if a string is a valid email address?
    ... I'm using Java 1.3 on Solaris. ... code that checks if a string satisfies being a valid email address ...
    (comp.lang.java.help)