"
or '
) as delimiters, they allow you to use any
non-alphanumeric character, or any matching pair of brackets or parentheses, as
delimiters. The qq operator, like double quotes, provides variable
interpolation, while the q operator does not. You can use these operators
to create strings containing quotes without having to use the backslash (\) to
escape them, as well as to create quoted strings with embedded newlines.
Thus, instead of typing this:
$hrefstr = "<a href=\"../$filename\">";you can use the qq operator:
$hrefstr = qq{<a href="../$filename">};
There are two other quoting operators that go beyond the capabilities of simple quotes.
The qw operator accepts a string consisting of ``words'', separated by
whitespace, and
returns an array whose elements are each of the words in the string.
This is similar
to the split function (Section 4.3), but may be more useful
when a literal list of words needs to be split. No variable interpolation is performed
by the qw
operator.
The qx operator first performs variable interpolation, then passes the resulting
string to the operating system, returning the output from the execution of the string
as a command. This functionality is similar to the backquote operator discussed in
Section .