#factorial through recursion use strict; use warnings; print "enter number\n"; my $num=<>; &fact($num,1); print "factorial: \n"; ################## sub fact { my($num1,$flag)=shift; if($num1==0) print "$flag" and die "brrrrrrrreeeeeee :D\n"; else {fact($num1-1,$num1*$flag);} }
In reply to factorial through recursion by hnd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |