in reply to Chomp doesn't seem to work
Er, I can never remember the darned line endings, but I'd try something like:
{ local $/ = "\n"; chomp $email; }
$/ is the input record separator. That's what chomp really removes. By using local in the brackets, you can temporarily reset that to whatever you need to chomp on. After you leave the brackets, $/ will have its previous value restored.
(I think it's "\n" for Unix, but I can't recall.)
Oh, wait. It's a Windows file uploaded to Unix that's the problem? Then I think the line ending might be "\r\n". I never keep those straight.
And for the record, the problem is because Unix and Windows use different line endings and chomp defaults to the line ending of the OS you currently are on.
Cheers,
Ovid
New address of my CGI Course.
|
|---|