I really can't find another explanation for this:
for <a b> -> $foo {
spurt "a/b", "bar";
}
say "Gotcha";
for <a b> {
spurt "a/b", "bar";
}
This prints "Gotcha" and then fails. I get that the last value in a loop is returned, and that if nothing is done with it it's in sink context, but what kind of change brings declaring a variable to it? It's still a Block, far as I can tell.
Using Rakudo 2022.07
returns:
Gotcha
Failed to open file /Users/admin/a/b: No such file or directory
in block <unit> at - line 6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With