Terrence Brannon
2005-09-09 02:03:42 UTC
I have an issue with import and inheritance that I cannot figure
out. When a certain module of mine is loaded at runtime, it forces a
chain of requires through the DBIx::SQLEngine distribution, leading to
this error:
"new_group_from_values" is not exported by the
DBIx::SQLEngine::Criteria module
Can't continue after import errors at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318
BEGIN failed--compilation aborted at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Record/Table.pm line
64.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/Class/MixinFactory/Factory.pm line
55.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
Compilation failed in require at Guestbook.cgi line 32.
BEGIN failed--compilation aborted at Guestbook.cgi line 32.
[Fri Sep 9 01:25:56 2005] [error] [client 24.130.176.67] Premature
end of script headers:
/var/www/terry/metaperl.org/cgi-bin/Guestbook.cgi
... and if you look at the file Criteria.pm you would not be surprised
to see this import error because no such sub exists in this file:
http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Criteria.pm
However, I can run 2 separate static small scripts which emulate what
is happening during the above chain of failed requires and they all
work.
First, a script which loads Guestbook::Model::entry (the module whose
require from Guestbook::App::sign_commit creates the error chain)
and does a commit to database... it does the commit perfectly.
entry.pl and entry.pm are here:
http://www.metaperl.org/Guestbook/Model/
In other words, even though it loads Guestbook::Model::entry, it does
not fail when loading the other modules in the DBIx::SQLEngine
distribution.
Now, the last thing that happens before the "not exported" error is
that Record/Table.pm does a require DBIx::SQLEngine::RecordSet::Set,
so I wrote a script which only does that and it runs just fine:
http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pl
So, the question becomes: why is it when CGI::Prototype::PathInfo does
a dynamic require of Guestbook::App::sign_commit and then
Guestbook::App::sign_commit does a use Guestbook::Model::entry that
the above chain of errors is thrown?
You can view PathInfo.pm here:
http://hcoop.net/~terry/perl/lib/CGI/Prototype/PathInfo.pm
out. When a certain module of mine is loaded at runtime, it forces a
chain of requires through the DBIx::SQLEngine distribution, leading to
this error:
"new_group_from_values" is not exported by the
DBIx::SQLEngine::Criteria module
Can't continue after import errors at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318
BEGIN failed--compilation aborted at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pm
line 318.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Record/Table.pm line
64.
Compilation failed in require at
/home/terry/perl/share/perl/5.8.7/Class/MixinFactory/Factory.pm line
55.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App/sign_commit.pm line 7.
Compilation failed in require at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
BEGIN failed--compilation aborted at
/var/www/terry/metaperl.org/Guestbook/App.pm line 17.
Compilation failed in require at Guestbook.cgi line 32.
BEGIN failed--compilation aborted at Guestbook.cgi line 32.
[Fri Sep 9 01:25:56 2005] [error] [client 24.130.176.67] Premature
end of script headers:
/var/www/terry/metaperl.org/cgi-bin/Guestbook.cgi
... and if you look at the file Criteria.pm you would not be surprised
to see this import error because no such sub exists in this file:
http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/Criteria.pm
However, I can run 2 separate static small scripts which emulate what
is happening during the above chain of failed requires and they all
work.
First, a script which loads Guestbook::Model::entry (the module whose
require from Guestbook::App::sign_commit creates the error chain)
and does a commit to database... it does the commit perfectly.
entry.pl and entry.pm are here:
http://www.metaperl.org/Guestbook/Model/
In other words, even though it loads Guestbook::Model::entry, it does
not fail when loading the other modules in the DBIx::SQLEngine
distribution.
Now, the last thing that happens before the "not exported" error is
that Record/Table.pm does a require DBIx::SQLEngine::RecordSet::Set,
so I wrote a script which only does that and it runs just fine:
http://hcoop.net/~terry/perl/share/perl/5.8.7/DBIx/SQLEngine/RecordSet/Set.pl
So, the question becomes: why is it when CGI::Prototype::PathInfo does
a dynamic require of Guestbook::App::sign_commit and then
Guestbook::App::sign_commit does a use Guestbook::Model::entry that
the above chain of errors is thrown?
You can view PathInfo.pm here:
http://hcoop.net/~terry/perl/lib/CGI/Prototype/PathInfo.pm
--
Carter's Compass: I know I'm on the right track when,
by deleting something, I'm adding functionality.
Carter's Compass: I know I'm on the right track when,
by deleting something, I'm adding functionality.