Customary | Generic | Meaning | Interpolates |
” |
q// |
Literal | No |
"" |
qq// |
Literal | Yes |
“ |
qx// |
Command | Yes |
() |
qw// |
Word list | No |
// |
m// |
Pattern match | Yes |
s/// |
s/// |
Substitution | Yes |
y/// |
tr/// |
Translation | No |
Any non-alphanumeric non-whitespace character can be used in place of /,
e.g.: $single = q!I said, "You said, 'She said it."'!;
.
The line-oriented form of quoting:
# with interpolation print <<EOF; The price is $Price; EOF # same as above print <<"EOF"; The price is $Price; EOF # no interpolation print <<'EOF'; The price is $Price; EOF # execute commands print <<`EOF`; ls -al EOF