my $x; $x = 0;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;{my $f = fact($x); print "factorial($x)=$f\n";} $x++;sub fact { $_[0] <= 0 and return 1; return $_[0] * fact($_[0] - 1); }