Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Explain why Perl5 subst code doesn't work in Perl6
  • Loading branch information
Paul Cochrane committed May 6, 2015
1 parent 1eda24d commit be215ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion categories/cookbook/01strings/01-01substrings.pl
Expand Up @@ -16,7 +16,7 @@

# want to replace everything but the first two letters with the string
# "gilism ain't for wimps"
# this code works in Perl 5, but not in Perl 6
# this code works in Perl 5, but not in Perl 6 since strings are immutable
# substr($string, $offset) = "gilism ain't for wimps";
# say $string;
$string = $string.substr(0, $offset) ~ "gilism ain't for wimps";
Expand Down

0 comments on commit be215ad

Please sign in to comment.