News for hackers. Stuff that matters.
Re:Why I Use Perl: Reliability by colomon on Tuesday May 29, 2012 @04:56PM (#4039848)
Just in case anyone was wondering, in Perl 6:

    sub factorial($n) {
        my $output = 1;
        for 1..$n -> $i {
            $output *= $i;
        }
        $output;
    }
or

    sub factorial2($n) {
        [*] 1..$n;
    }
Pretty anonymous function to add a constant:

    -> $x { $x + 7 }
Really short version:

    * + 7
Named:

    sub plus7($x) {
        $x + 7;
    }

There are no comments on this comment yet.