![]() |
perl error with recursion
hi i have a program that i tweaked from python (which i know) to perl (changed syntax). here is the program.
:
#!/usr/bin/perlwhen i run the program i get the following. :
Not enough arguments for main::fib at fibrecursion.pl line 18, near "$n)"thanks |
In perl, you can't pass arguments via the subroutine definition. Instead, you pull the subroutine's arguments from the list @_. Try this instead:
:
|
| All times are GMT -5. The time now is 9:39 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC