in reply to problem with repeating function
Program 2: demo.pm - an instance is created by the executable:#!/exlibris/metalib/m4_b/product/bin/perl use demo; { my $externalObject = new demo; }
Program 3: demo2.pm - an istance is created by demo.pmpackage demo; require "wrapper"; use demo2; sub new { my $class = shift; my $params = shift; my $self = {}; &call_httpd_exec(); my $externalObject2 = new demo2; }
Program 4: wrapper - the required program:package demo2; require "wrapper"; sub new { my $class = shift; my $params = shift; my $self = {}; &call_httpd_exec(); }
When I run the executable program, I get this message:sub call_httpd_exec{ print "hello world!!\n" } 1;
If I don't make demo.pm create an instance of demo2.pm there is no problem. Why do you think adding demo2.pm creates a problem?Undefined subroutine &demo::call_httpd_exec called at demo.pm line 8.
|
|---|