in reply to problem with repeating function

OK, since reducing my programs from over a thousand lines of code to a short snippet was not so simple, I wrote a few short snippets that show you the same problem: Program 1 (the executable):
#!/exlibris/metalib/m4_b/product/bin/perl use demo; { my $externalObject = new demo; }
Program 2: demo.pm - an instance is created by the executable:
package demo; require "wrapper"; use demo2; sub new { my $class = shift; my $params = shift; my $self = {}; &call_httpd_exec(); my $externalObject2 = new demo2; }
Program 3: demo2.pm - an istance is created by demo.pm
package demo2; require "wrapper"; sub new { my $class = shift; my $params = shift; my $self = {}; &call_httpd_exec(); }
Program 4: wrapper - the required program:
sub call_httpd_exec{ print "hello world!!\n" } 1;
When I run the executable program, I get this message:
Undefined subroutine &demo::call_httpd_exec called at demo.pm line 8.
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?