Thread
:
perl error with recursion
View Single Post
Nov 6th, 2006, 4:08 AM
#
2
Arevos
Programming Guru
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power:
5
In perl, you can't pass arguments via the subroutine definition. Instead, you pull the subroutine's arguments from the list @_. Try this instead:
perl Syntax
(
Toggle Plain Text
)
sub
fib
{
(
$n
)
=
@_
;
...
}
sub fib { ($n) = @_; ... }
Arevos
View Public Profile
Visit Arevos's homepage!
Find More Posts by Arevos