Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • subset Guess where { $_ >= 1 && $_ if 42 ~~ Guess { say "yes" } else { say "no" }
    yes
    if 142 ~~ Guess { say "yes" } else { say "no" }
    no
    if 97 ~~ Guess { say "yes" } else { say "no" }
    yes
    subset LowGuess of Guess where { $_ if 42 ~~ LowGuess { say "yes" } else { say "no" }
    yes
    if 97 ~~ LowGuess { say "yes" } else { say "no" }
    no
    if 0 ~~ LowGuess { say "yes" } else { say "no" }
    no

    Are there some curlies/newlines missing here? I'm having difficulty parsing it. (particularly as I've never come across the subset keyword before :)

    Other than that, though - it's nice to see what's happening - thanks!
    • AFAIK the parentheses around the condition are optional in Perl6. So the lines starting with "if" should be ok.
      On the other hand me also thinks that the lines starting with "subset" got mixed up...
    • I'd not written some angle brackets as HTML entities, which resulted in mangled output. Sorry, and fixed now - thanks for pointing it out!