hi i have a program that i tweaked from python (which i know) to perl (changed syntax). here is the program.
#!/usr/bin/perl
sub fib($n)
{
if ($n<2)
{
return 1;
}
else
{
return fib($n-1) + fib($n-2);
}
}
$n = 1;
while ($n < 42)
{
print fib($n);
print " ";
$n = $n + 1;
}
when i run the program i get the following.
Not enough arguments for main::fib at fibrecursion.pl line 18, near "$n)"
Execution of fibrecursion.pl aborted due to compilation errors.
any help would be appreciated
thanks