RosettaCodeData/Task/Factorial/Perl/factorial-3.pl
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

6 lines
94 B
Raku

use List::Util qw(reduce);
sub factorial
{
my $n = shift;
reduce { $a * $b } 1, 1 .. $n
}