X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlretut.pod;h=22fc44a7b2c75e87bab8c08eff316e0104712868;hb=e74a3e73f5e128a77b691fcfc83214f58419a493;hp=67e06700d4d8130a072d4be1379216e8301816c2;hpb=353c650532037e4006fbdb2176350717f320f7c3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlretut.pod b/pod/perlretut.pod index 67e0670..22fc44a 100644 --- a/pod/perlretut.pod +++ b/pod/perlretut.pod @@ -2088,7 +2088,7 @@ algorithm. while( $command = <> ){ $command =~ s/^\s+|\s+$//g; # trim leading and trailing spaces if( ( @matches = $kwds =~ /\b$command\w*/g ) == 1 ){ - print "command: '$matches'\n"; + print "command: '@matches'\n"; } elsif( @matches == 0 ){ print "no such command: '$command'\n"; } else { @@ -2133,8 +2133,8 @@ example is This style of commenting has been largely superseded by the raw, freeform commenting that is allowed with the C modifier. -The modifiers C, C, C, C and C (or any -combination thereof) can also embedded in +The modifiers C, C, C and C (or any +combination thereof) can also be embedded in a regexp using C<(?i)>, C<(?m)>, C<(?s)>, and C<(?x)>. For instance, /(?i)yes/; # match 'yes' case insensitively @@ -2159,7 +2159,7 @@ that must have different modifiers: } } -The second advantage is that embedded modifiers (except C, which +The second advantage is that embedded modifiers (except C, which modifies the entire regexp) only affect the regexp inside the group the embedded modifier is contained in. So grouping can be used to localize the modifier's effects: @@ -2420,9 +2420,9 @@ containing just one word character is a palindrome. Otherwise it must have a word character up front and the same at its end, with another palindrome in between. - /(?: (\w) (?...Here be a palindrome...) \{-1} | \w? )/x + /(?: (\w) (?...Here be a palindrome...) \g{-1} | \w? )/x -Adding C<\W*> at either end to eliminate was is to be ignored, we already +Adding C<\W*> at either end to eliminate what is to be ignored, we already have the full pattern: my $pp = qr/^(\W* (?: (\w) (?1) \g{-1} | \w? ) \W*)$/ix;