diff options
author | Robert Spier <rspier@pobox.com> | 2003-10-05 14:34:30 -0700 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2003-10-06 03:26:39 +0000 |
commit | 865c4c6f6836f5d201ca85b078e35d1e47de908b (patch) | |
tree | 3187fbd4bbd29147a6b9ab07531f3568470225f7 /pod | |
parent | 2ec0bfb3e2d19a14c6a2cf1939c9549394a191c1 (diff) | |
download | perl-865c4c6f6836f5d201ca85b078e35d1e47de908b.tar.gz |
Re: [PATCH] [perl #24113] mistake in perlretut
Message-Id: <m3vfr39e7d.wl_rspier@pobox.com>
p4raw-id: //depot/perl@21403
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlretut.pod | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pod/perlretut.pod b/pod/perlretut.pod index 6e06f19291..be4693dd0f 100644 --- a/pod/perlretut.pod +++ b/pod/perlretut.pod @@ -158,13 +158,14 @@ that a metacharacter can be matched by putting a backslash before it: "2+2=4" =~ /2\+2/; # matches, \+ is treated like an ordinary + "The interval is [0,1)." =~ /[0,1)./ # is a syntax error! "The interval is [0,1)." =~ /\[0,1\)\./ # matches - "/usr/bin/perl" =~ /\/usr\/local\/bin\/perl/; # matches + "/usr/bin/perl" =~ /\/usr\/bin\/perl/; # matches In the last regexp, the forward slash C<'/'> is also backslashed, because it is used to delimit the regexp. This can lead to LTS (leaning toothpick syndrome), however, and it is often more readable to change delimiters. + "/usr/bin/perl" =~ m!/usr/bin/perl!; # easier to read The backslash character C<'\'> is a metacharacter itself and needs to be backslashed: |