| 187 | | Many many changes. Just read S05. But if you're in a panic and need |
| 188 | | to get something working now, you just need to know that you can use |
| 189 | | Perl 5-compatible regexes with the C<:P5> modifier. And that |
| 190 | | modifiers come before, not after, regexes in Perl 6. Oh, and that |
| 191 | | C<=~> has changed to C<~~>.... |
| 192 | | |
| 193 | | Was: $str =~ /^\d{2,5}\s/ |
| 194 | | Now: $str ~~ m:P5/^\d{2,5}\s/ |
| | 187 | Here's a simple translation of a Perl5 regular expression to Perl6: |
| | 188 | |
| | 189 | Was: $str =~ m/^\d{2,5}\s/i |
| | 190 | Now: $str ~~ m:P5:i/^\d{2,5}\s/ |
| | 191 | |
| | 192 | The 'P5' modifier is there because the standard Perl6 syntax is rather |
| | 193 | different, and 'P5' notes a Perl5 compatibility syntax. For the full |
| | 194 | specification, see L<S05>. See also: |
| | 195 | |
| | 196 | The related Apocalypse, which justifies the changes: |
| | 197 | |
| | 198 | http://dev.perl.org/perl6/doc/design/apo/A05.html |
| | 199 | |
| | 200 | And the related Exegesis, wihch explains it more detail: |
| | 201 | |
| | 202 | http://dev.perl.org/perl6/doc/design/exe/E05.html |