"zoomcart.com" <> wrote in news:6e98e552-1d5e-
4b27-8c10-:
> Hello and thanks in advance for you help.
> I have a simple email program that has a bulk add feature where a user
> can add an email list separated by returns. It works fine, except when
> the user tries to edit and remove an email, the script is not
> recognizing the email. If the email was added individually, it
> recognizes it. This may only be caused when the user is using a mac.
Line endings are different on the Mac CRLF for DOSish systems, LF for
*nixes and CR for the old Mac OS.
The code you have provided below is simply an undreadable mess. Don't
code like this but more importantly, don't post like this. Please take a
look at the Posting Guidelines to learn how to help others help you.
> while (<USERS>)
> {
> $line = $_;
while ( my $line = <USERS> ) {
> chomp $line if ($line =~ /\n$/);
A line, by definition, ends with a newline.
Assuming whitespace at the end of an email address cannot be significant
(the assumption makes sense to me but I don't know the RFC), how about
:
$line =~ s/\s+$//;
Sinan
--
A. Sinan Unur <>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/