in reply to Re: @ symbol in html output
in thread @ symbol in html output
From perlop:#!/usr/bin/perl -wT use strict; ## wrong, causes error # print "\Qblakem@foo1.com\E\n"; ## wrong, prints the backslashes print quotemeta('blakem@foo2.com'),"\n"; ## wrong, still prints backslashes my $escaped = quotemeta('blakem@foo3.com'); print "$escaped\n"; print $escaped, "\n"; ## right my $email = 'blakem@foo4.com'; print "$email\n"; ## right print "blakem\@foo5.com\n"; print 'blakem@foo6.com',"\n"; =output blakem\@foo2\.com blakem\@foo3\.com blakem\@foo3\.com blakem@foo4.com blakem@foo5.com blakem@foo6.com
So, either put the backslash in by hand if you are simply printing the stringYou cannot include a literal $ or @ within a \Q sequence. An unescaped + $ or @ interpolates the corresponding variable, while escaping will cause the literal stri +ng \$ to be inserted. You'll need to write something like m/\Quser\E\@\Qhost/.
or assign it to a scalar and print the scalarprint "blakem\@foo.com"; print 'blakem@foo.com';
my $email = 'blakem@foo.com'; print $email;
-Blake
|
|---|