hnd has asked for the wisdom of the Perl Monks concerning the following question:
why is this piece of code not working?
it shows a syntax error at line 10 and 13
it shows a syntax error at line 10 and 13
#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);} }
=====================================================
i'am worst at what do best and for this gift i fell blessed...
i found it hard it's hard to find well whatever
NEVERMIND
i'am worst at what do best and for this gift i fell blessed...
i found it hard it's hard to find well whatever
NEVERMIND
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: factorial through recursion
by blokhead (Monsignor) on Jul 23, 2009 at 19:48 UTC | |
Re: factorial through recursion
by ikegami (Patriarch) on Jul 23, 2009 at 19:55 UTC | |
by lidden (Curate) on Jul 24, 2009 at 09:36 UTC | |
by ikegami (Patriarch) on Jul 24, 2009 at 16:10 UTC | |
Re: factorial through recursion
by SuicideJunkie (Vicar) on Jul 23, 2009 at 19:45 UTC | |
Re: factorial through recursion (diagnostics)
by toolic (Bishop) on Jul 23, 2009 at 20:13 UTC | |
Re: factorial through recursion
by imrags (Monk) on Jul 24, 2009 at 06:56 UTC | |
Re: factorial through recursion
by Anonymous Monk on Jul 23, 2009 at 19:53 UTC |
Back to
Seekers of Perl Wisdom