Skip to content

Commit 2603f6f

Browse files
committed
Fix up a few more post-GLR issues
1 parent 6f05981 commit 2603f6f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

categories/best-of-rosettacode/balanced-brackets.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ =head2 FP oriented
6767
{
6868
sub balanced($s) {
6969
.none < 0 and .[*-1] == 0
70-
given [\+] '\\' «leg« $s.comb;
70+
given [\+] '\\' «leg« $s.comb.cache;
7171
}
7272

7373
my $s = <[ ]>.roll($n*2).join;

categories/wsg/advanced-2008/event001-eric256.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114

115115
sub MAIN(Bool :$verbose = False) {
116116
my $input-file = $*SPEC.catdir($*PROGRAM-NAME.IO.dirname, "wordlist.txt");
117-
my %dict = ( ($input-file.IO.slurp.split("\n").grep: {.chars == 7}) X 1);
117+
my %dict = (($input-file.IO.lines.grep: {.chars == 7}) X 1).flat;
118118

119119
my %digits = (
120120
2 => (<a b c>),

categories/wsg/advanced-2008/event005-eric256.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ (Str :$pw = "", Bool :$verbose = False)
149149
my $password = $pw || prompt("Enter password to test: ");
150150

151151
my $input-file = $*SPEC.catdir($*PROGRAM-NAME.IO.dirname, "wordlist.txt");
152-
my %dict = ( ($input-file.IO.slurp.split("\n").grep: {.chars > 6}) X 1);
152+
my %dict = (($input-file.IO.lines.grep: {.chars > 6}) X 1).flat;
153153

154154
say "Testing strength of password '$password'" if $verbose;
155155

categories/wsg/beginner-2008/event001-eric256.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343

4444
my @cards = qw{6 5 6 6 K};
4545
my $p = 0;
46-
for @cards[0..@cards-2].kv -> $k, $v {
47-
$p += (@cards[$k+0 .. ^*-1].grep: {$_ eq $v}).elems -1
48-
};
46+
for @cards.kv -> $k, $v {
47+
$p += @cards[$k+1 .. *].grep: {$_ eq $v}
48+
}
4949
say "Total: $p";
5050

5151
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)