in reply to fibonacci numbers using subroutine?
The way you described things, this sounds like a programming class assignment. As such, I don't want to do your homework for you. I apologize if I misread the intent behind your question.
Anyways, you're about 90% there with your code anyways. Just put your for loop in a subroutine. Then all you need to do is pass values into and out of it. To learn more about using subroutines, I'd recommend checking out perldoc or the PerlMonks' tutorial on subroutines.
I'm giving you generic information because you'll learn more this way as opposed to just giving you the code to do it. Try checking out those links and experiment with what you learn from them. If you're still struggling, just post your code along with your questions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: fibonacci numbers using subroutine?
by derpp (Acolyte) on Aug 19, 2010 at 23:01 UTC |