Recursive subroutine
sub factorial { my $value = shift (@_); return $value == 1 ? $value : $value * factorial ($value - 1); } $result = factorial(6); print $result;