in reply to Perl6 regex substitutions
The second example calls the subst method on $x (that's why you see a dot), and then mutates it (the equal sign).use v6; my $x = "this is a test".subst(/\s/, '-', :g); # or my $x = "this is a test"; $x.=subst(/\s/, '-', :g);
:g is again the adverb for global matching, like in s:g///.
|
|---|