From 1e2a213df405afd579850b5ecf53ab85e0bd0fbe Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 1 Apr 2011 22:05:28 -0600 Subject: perlrequick: Capitalize Perl when used as a noun This is for consistency with other pods --- pod/perlrequick.pod | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pod/perlrequick.pod b/pod/perlrequick.pod index 557cd49106..62ea5330eb 100644 --- a/pod/perlrequick.pod +++ b/pod/perlrequick.pod @@ -19,7 +19,7 @@ contains that word: "Hello World" =~ /World/; # matches In this statement, C is a regex and the C enclosing -C tells perl to search a string for a match. The operator +C tells Perl to search a string for a match. The operator C<=~> associates the string with the regex match and produces a true value if the regex matched, or false if the regex did not match. In our case, C matches the second word in C<"Hello World">, so the @@ -58,7 +58,7 @@ statement to be true: "Hello World" =~ /o W/; # matches, ' ' is an ordinary char "Hello World" =~ /World /; # doesn't match, no ' ' at end -perl will always match at the earliest possible point in the string: +Perl will always match at the earliest possible point in the string: "Hello World" =~ /o/; # matches 'o' in 'Hello' "That hat is red" =~ /hat/; # matches 'hat' in 'That' @@ -235,11 +235,11 @@ boundary. We can match different character strings with the B metacharacter C<'|'>. To match C or C, we form the regex -C. As before, perl will try to match the regex at the +C. As before, Perl will try to match the regex at the earliest possible point in the string. At each character position, -perl will first try to match the first alternative, C. If -C doesn't match, perl will then try the next alternative, C. -If C doesn't match either, then the match fails and perl moves to +Perl will first try to match the first alternative, C. If +C doesn't match, Perl will then try the next alternative, C. +If C doesn't match either, then the match fails and Perl moves to the next position in the string. Some examples: "cats and dogs" =~ /cat|dog|bird/; # matches "cat" @@ -377,7 +377,7 @@ operators. In the code print if /$pattern/; } -perl has to re-evaluate C<$pattern> each time through the loop. If +Perl has to re-evaluate C<$pattern> each time through the loop. If C<$pattern> won't be changing, use the C modifier, to only perform variable substitutions once. If you don't want any substitutions at all, use the special delimiter C: -- cgit v1.2.1