Escape double quote in double quote : Quotations « String « Perl

Escape double quote in double quote


#!/usr/bin/perl -w

print "'\"Hi,\" said Jack. \"Have you read Slashdot today?\"'\n";


Related examples in the same category

1.A single q creates a single-quoted string:
2.Alternative Quotes: qq, q, qw, qx
3.Alternative delimiters can be used for all four of the q constructs.
4.Assign returning value from qw to an array
5.Backquotes and command substitution
6.Backslash Escapes in Perl
7.Demonstrating the qw operator
8.Display double quotation marks in a printed string
9.Double quote string
10.Double quote with windows file path
11.Escape double quote
12.Escaping the double quote
13.If a string is enclosed in single quotes, it is printed literally (what you see is what you get).
14.Interpolate and double quote
15.Nested alternative quotes
16.Perl 5 Quotation Marks
17.Perl's Alternative Quotes
18.Print with double vs. single quotes
19.Printing without Quotes: The here document
20.Properties of printing with single quotes
21.Put double quote into single quote
22.Put qotation marks in q function
23.Put single quote into double quote
24.Quote Operators
25.Quote with qq# (number sign)
26.Quote with qq< (less than)
27.Quote with qq( (parenthesis)
28.Quote with qq| (bar)
29.Single quote string
30.Single quote with windows file path
31.Single quotes do not interpret
32.Single quotes interpret
33.The difference between single and double quotes
34.The qq operator does the same for double-quoted strings
35.Using alternative quotes
36.Using backslash for double quote
37.Using qq for quote
38.Using qw to assign value to scalar
39.Using qw to create string array without quotation marks
40.When a string is enclosed in double quotes, scalar variables and arrays are interpolated.
41.You can change the delimiters with the q operator
42.\n with double quotation
43.$statement = q/print "Hello.";/;
44.$statement = qq/print "Hello.";/;
45.qx command
46.All Perl math operations are performed on double-precision floating-point values.
47.assigns a single quote
48.interpolation with with double quote
49.print qq|I said, "Hello".|;
50.qq function with variable interpolation
51.qw across more than one lines
52.Turn off the special effect a backslash has, and so we escape it:
53.Assigning a double quote by \"
54.Alternative Delimiters
55.Using backticks to capture program output.
56.`` returns the result of an shell command