apprentice has asked for the wisdom of the Perl Monks concerning the following question:
I have one function that calls itself recursively. When I prototype that function, I get the error message: "parseLine() called too early to check prototype at ssi-parser.pl line 381".
Here's the code:
Here's the code:
Anyone know how to get prototyping to work for this?#!/usr/local/bin/perl -w use strict; sub main() { doSomething("1","2","0"); print "Done\n"; } sub doSomething($$$) { my ($data1, $data2, $count) = @_; print "\$data1: $data1, \$data2: $data2, \$count: $count\n"; $data1++, $data2++, $count++; if ($count < 4) { doSomething($data1, $data2, $count); } } main();
Thanks,
Apprentice
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: problem prototyping a self-recursing function
by japhy (Canon) on Dec 07, 2001 at 01:13 UTC | |
by Rex(Wrecks) (Curate) on Dec 07, 2001 at 03:00 UTC | |
Re (tilly) 1: problem prototyping a self-recursing function
by tilly (Archbishop) on Dec 07, 2001 at 04:35 UTC | |
Re: problem prototyping a self-recursing function
by frankus (Priest) on Dec 07, 2001 at 16:26 UTC | |
by thraxil (Prior) on Dec 08, 2001 at 00:15 UTC | |
by frankus (Priest) on Dec 08, 2001 at 00:51 UTC |
Back to
Seekers of Perl Wisdom