summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-17 16:34:09 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-17 16:34:09 +0000
commit87275199ef473a0bd08ce6f46db30d4d432f4876 (patch)
tree3f8e18dd43f70fe33e25ec58f37ac2a0bea79a51 /pod/perlop.pod
parentfa9c2ea87c89382fe822598450654e31bdb24ee0 (diff)
downloadperl-87275199ef473a0bd08ce6f46db30d4d432f4876.tar.gz
pod fixes (with minor edits) from Abigail, Ronald Kimball, Jon
Waddington, Tuomas Lukka, Steven Tolkin, Ian Phillipps, and Steve Lidie p4raw-id: //depot/perl@3676
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod21
1 files changed, 18 insertions, 3 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 0f8117ced9..3234131f90 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -620,9 +620,7 @@ function as operators, providing various kinds of interpolating and
pattern matching capabilities. Perl provides customary quote characters
for these behaviors, but also provides a way for you to choose your
quote character for any of them. In the following table, a C<{}> represents
-any pair of delimiters you choose. Non-bracketing delimiters use
-the same character fore and aft, but the 4 sorts of brackets
-(round, angle, square, curly) will all nest.
+any pair of delimiters you choose.
Customary Generic Meaning Interpolates
'' q{} Literal no
@@ -634,6 +632,23 @@ the same character fore and aft, but the 4 sorts of brackets
s{}{} Substitution yes (unless '' is delimiter)
tr{}{} Transliteration no (but see below)
+Non-bracketing delimiters use the same character fore and aft, but the four
+sorts of brackets (round, angle, square, curly) will all nest, which means
+that
+
+ q{foo{bar}baz}
+
+is the same as
+
+ 'foo{bar}baz'
+
+Note, however, that this does not always work for quoting Perl code:
+
+ $s = q{ if($a eq "}") ... }; # WRONG
+
+is a syntax error. The C<Text::Balanced> module on CPAN is able to do this
+properly.
+
There can be whitespace between the operator and the quoting
characters, except when C<#> is being used as the quoting character.
C<q#foo#> is parsed as the string C<foo>, while C<q #foo#> is the