Hacker News new | past | comments | ask | show | jobs | submit login

Actually this feature is in Perl5, you just have to ask the compiler for a recent enough version.

Though it has been marked as experimental because the Perl6 design for this didn't fit into Perl5 as well as was hoped for. That is it had edge-cases that need to be worked through before it is recommended for general use.

    use v5.10;
    no warnings qw(experimental);

    given (1) {
      when (1) { say 'one' } # only prints this line
      when (1) { say 1 }
    }





Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: