You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Oleg Kobyakovskiy <ok...@dions.net> on 2003/02/19 19:53:49 UTC

Problem with function from file included by 'require functions.pl'

Hello everybody,

I have a .pl file with 2 function definitions. I include this file in 
global.asa to use defined functions through:
require 'file.pl';
.
It works fine. But some time I get the error like:

[Wed Feb 19 13:28:01 2003] [error] [asp] [4391] [error] Undefined 
subroutine 
&Apache::ASP::Compiles::__ASP__usr_local_apache_2_servers_lensesx::cc_decrypt 
called at /usr/local/apache-2/servers/lenses/private/show-invoice.pl 
line 40. <--> , /opt/perl/lib/site_perl/5.8.0/Apache/ASP.pm line 1491

So script show-invoice.pl do not see this function any more. After I 
restart apache it works fine again. I've got it few times already. 
Scripts lost this function in few days after apache restarted.

Does anybody have any ideas?

PS: I use the Apache/2.0.44 (Unix) mod_perl/1.99_08 Perl/v5.8.0 
mod_ssl/2.0.44 OpenSSL/0.9.6g  +  Apache::ASP v2.51

Thanks for help.

-- 
Best regards.

Oleg                      ok@dinos.net
(nic-hdl)                 OKU11
Fax: +1 801 749 3182


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org


Re: Problem with function from file included by 'require functions.pl'

Posted by Josh Chamas <jo...@chamas.com>.
Oleg Kobyakovskiy wrote:
> Hello everybody,
> 
> I have a .pl file with 2 function definitions. I include this file in 
> global.asa to use defined functions through:
> require 'file.pl';
> .
> It works fine. But some time I get the error like:
> 
> [Wed Feb 19 13:28:01 2003] [error] [asp] [4391] [error] Undefined 
> subroutine 
> &Apache::ASP::Compiles::__ASP__usr_local_apache_2_servers_lensesx::cc_decrypt 
> called at /usr/local/apache-2/servers/lenses/private/show-invoice.pl 
> line 40. <--> , /opt/perl/lib/site_perl/5.8.0/Apache/ASP.pm line 1491
> 

If you have multiple file.pl that your code will require, this
will mess with Perl's %INC, and you may get the wrong results.
There can be only one unique file.pl per web server, even across
virtual hosts.  You might be better off having them be directly
in the global.asa, or making a real unique perl module out of it
that you can "use" like "use My::Unique::Module::Functions;"

Regards,

Josh

________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org