This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi: Place in dictionary sort order
[perl5.git] / lib / perl5db / t / fact
CommitLineData
ea7bdd87
VP
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6sub fact {
7 my $n = shift;
8 if ($n > 1) {
9 return $n * fact($n - 1);
10 } else {
11 return 1;
12 }
13}
14fact(5);