Perl Variable problem with e-mail address

Hi All,

I’m trying to set up a perl script on my website, but can’t seem to pass an e-mail address through it as a variable. Here is what i have:

$ouremail = “email@my-domain.co.uk”; and when i call it later on in the script as VendorMail=$ouremail (this is protx i’m setting up by the way), it passes the e-mail through as email-domain.co.uk completely ignoring the @my bit of the address.

Has anyone got any ideas, as this is the last bit I need to do and it’s driving me mad!!!

Thanks,
chodges84

The @ symbol is a reserved character in perl, it means an array. When you put an @ symbol inside of a double-quoted string perl thinks you want to expand the array into a string. To avoid interpolation/expansion of variables, use single-quotes or escape special characters with a back-slash inside of a double-quoted string:

$ouremail = 'email@my-domain.co.uk';

or:

$ouremail = "email\\@my-domain.co.uk";