in reply to @ symbol in html output

Without error logs (can you provide some?) it is dificult to spot the problem, however it's most probably because @ followed by a variable name is interpolated in a double quoted string, or its equivalent, so

print "My email is foo@bar.com";

tries to print the array @bar.

To avoid this, use single quotes, or escape every @ in email addresses putting a backslash before it, like this:

print "My email is foo\@bar.com"; print 'My email is foo@bar.com';

Also remember that single quotes prevent interpolation, so if yuo have \n in your string, it won't be interpreted as a newline anymore.

-- TMTOWTDI

Replies are listed 'Best First'.
Re: Re: @ symbol in html output
by andye (Curate) on Sep 23, 2001 at 20:14 UTC
    Good advice. Some more options:

    A here document:

    print <<'END_HTML'; email is officer@dibble.com this is still html <p> <blink>foo</blink> END_HTML
    Or quoting like this:
    print q{ email is officer@dibble.com this is still html <p> <blink>foo</blink> };

    Both of these options will prevent you from being caught out by awkward apostrophes (e.g. you would get in trouble with print 'my brother's email is a@b').

    NB.
    For the here document: if you want interpolation do print <<"END_HTML";. You can use whatever text you like instead of END_HTML.
    For the q{} quoting: if you want interpolation, use qq{}. You can use whatever sort of brackets you like, e.g. q().

    hth, andy.