$num = 10;print &factorial($num);sub factorial { my ($num) = @_; if ($num < 2) { return 1; }else{ return ($num * &factorial($num-1)); }}