Schlabach, Torsten wrote:
> Dear list,
> 
> I have a problem with Perl and I have no idea at all how to search
> for it. 
> 
> I have a CGI script that is calling a perl module. One function in
> that module uses a sub which is defined only later in the source, but
> there is a forward declaration available for the function with sub.
> Conceptionally this looks like this:   
> 
> FooModule.pm:
> 
> package FooModule;
> 
> sub usedLater;
> 
> sub theFunctionCalledFromoutside{
> 
> ...
> 
> ...
> 
> usedLater( $argument );
> 
> }
> 
> sub usedLater{
> 
> [... some code ...]
> 
> }
> 
> 1;
> 
> The call
> 
> usedLater( $argument );
> 
> leads to this errror
> 
> Undefined subroutine &FooModule::usedLater called at ...
> 
> Any idea where to search? This is code I did not write myself and
> others have reported it worked for them unter Perl 5.8.1. I have
> 5.8.0. I also tried with 5.8.5, but got the same error, so this does
> not look like a Perl version issue.   

The forward declaraction is not necessary. There's nothing in the snippet
you posted to explain the error; it should be working.

Is this a pure CGI environment, or are you running under mod_perl or
similar? Are you sure there is no package statement before the declaration
of usedLater? Are you positive there are no typos?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to