[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] perl question with email addresses

In laws are more fun than Ale?

-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Mike
Sent: Monday, December 01, 2008 3:32 PM
To: ale at ale.org
Subject: Re: [ale] perl question with email addresses

Geoffrey wrote:
> I know that when you specify an email address in perl you have to
> the @ as in:
> $email = "who\@where.com";
> My problem is, I've got a cgi perl script that is being passed an
> address of the form:  "who at where.com"
> For the life of me, I can't figure out how to convert this to 
> "who\@where.com"

Seeing as this was already not the problem I'll just comment for 
completeness' sake.

The backwhacking of the @ is only necessary in double quoted ("", qq{}) 
strings because otherwise Perl would attempt to interpolate the contents

of an array named "@where".  If you have a piece of data that's come 
from another source (e.g. a form submission) the backslash isn't needed 
as it's not going to be processed by Perl again (unless you of course 
run it through some form of eval :).

An alternative if you don't need to interpolate anything else is to use 
a quotelike operator which doesn't do interpolation ('who at where.com' or 
q{who at where.com} for example).

> Fletch where are you buddy??? :)
In Florida at the inlaws not checking my list mailbox . . . :)

Ale mailing list
Ale at ale.org
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.