Changeset 13107 for docs/Perl6/Perl5

Show
Ignore:
Timestamp:
09/08/06 04:03:23 (2 years ago)
Author:
markstos
Message:

Add a s/// example to Differences.pod

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Perl5/Differences.pod

    r13014 r13107  
    188188 
    189189The C<:P5> modifier is there because the standard Perl6 syntax is rather 
    190 different, and 'P5' notes a Perl5 compatibility syntax.  For the full 
    191 specification, see L<S05>. See also: 
     190different, and 'P5' notes a Perl5 compatibility syntax.  For a substitution:  
     191 
     192    Was:    $str =~ s/(a)/$1/e; 
     193    Now:    $str ~~ s:P5/(a)/{$0}/; 
     194 
     195Notice that C<$1> starts at C<$0> now, and C</e> is gone 
     196in favor of the embedded closure notation.  
     197 
     198For the full specification, see L<S05>. See also: 
    192199 
    193200The related Apocalypse, which justifies the changes: