in reply to Re^2: Parse file to Hash of Hash etc.
in thread Parse file to Hash of Hash etc.
but this obviously doesn't work, 'cause it will keep going and going, so you need a stopping point too.sub factorial { my $n = shift; return $n * &factorial( $n - 1 ); }
Try searching Google for recursive functions, recursive subs, recursion, etc.sub factorial { my $n = shift; if ( $n == 1 ) { return 1 } return $n * &factorial( $n - 1 ); }
|
|---|