sub factorial { my ($i) = @_; return 1 if ( $i <= 0 ); return $i * factorial( $i-1 ); } #### factorial 0 : 1; factorial i : i * factorial( i - 1 );