# quote characters same as the string delimiter
my $example = "Tried and \"true.\"";
my $triteness = 'Constant is constant and isn\'t edifying.';
Option 2—use the brilliant perl functions qq, q, qx, qw, qr, or <<; depending on what you’re trying trying to quote and how you’d like to do it.
# you can use almost anything for your quote delimiters
print qq/A "$variable" and newline!\n/, q(A real '$dollar sign.');
print <<'';
Don't be a tricky bastard now!
I won't stand for it.
print qx,/usr/bin/banner phat ashley,;
See the rest in the perldoc perlop. You should look at perldoc -f quotemeta too.
[close]
Permanent link · http://querylog.com/q/perl+quotes+in+quotes