You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Introduction to Perl 6 Regex, in the section titled modifiers, the example using the :sigspace modifier causes an error. The text says:
This is so useful that Perl provides a nice short-cut for it.
/\s*One\s+small\s+step\s*/ # yuck
m:sigspace/One small step/ # much better
mm/One small step/ # even better!
However, the last line causes an error when I try it:
~/p6_programs$ perl6 -v
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.
~/p6_programs$ cat 4.pl
# vim: filetype=perl6
$_ = "One small step";
mm/One small step/; # even better!
say $/;
~/p6_programs$ perl6 4.pl
===SORRY!=== Error while compiling /Users/7stud/p6_programs/4.pl
Missing required term after infix
at /Users/7stud/p6_programs/4.pl:4
------> mm/One small step/⏏; # even better!
expecting any of:
prefix
term
Using the modifier :s works as described:
~/p6_programs$ cat 4.pl
# vim: filetype=perl6
$_ = "One small step";
m:s/One small step/; # even better!
say $/;
~/p6_programs$ perl6 4.pl
「One small step」
The text was updated successfully, but these errors were encountered:
7stud
changed the title
Regex modifier example causes error
Regex :sigspace modifier example causes error
Jan 7, 2017
In Introduction to Perl 6 Regex, in the section titled modifiers, the example using the
:sigspace
modifier causes an error. The text says:However, the last line causes an error when I try it:
Using the modifier
:s
works as described:The text was updated successfully, but these errors were encountered: