M
Marc Girod
Hello,
From an autoloaded function, a require statement succeeds, without
importing any function.
Using the same module works fine from a normal script.
I suspect a problem with my own autoloaded module, or an interaction
of the autoload mechanism.
The code snippet from my autoloaded function:
--8<------
package ClearCase::Wrapper::MGi;
$VERSION = '0.11';
use warnings;
use strict;
use vars qw($ct $eqhl $prhl $diat);
($eqhl, $prhl, $diat) = qw(EqInc PrevInc DelInc);
sub compareincs($$) {
....
}
use AutoLoader 'AUTOLOAD';
use ClearCase::Wrapper;
....
sub unlock() {
my $fl = "ClearCase::Wrapper::ForceLock";
eval "require $fl";
....
--8<------
My test script:
--8<------
#!/usr/bin/perl -w
use ClearCase::Wrapper::ForceLock;
my $lt = 'ZZZ_1.00';
my $v = '/wran_cm_makesystem';
flocklt($lt, $v);
--8<------
Under the debugger, with the latter, I get:
main:./flock:5): my $lt = 'ZZZ_1.00';
DB<1> S ClearCase::Wrapper::ForceLock.*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::ForceLock::flocklt
ClearCase::Wrapper::ForceLock::funlocklt
ClearCase::Wrapper::ForceLock::ssh
Whereas with the former:
o blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):954):
954: eval "require $fl";
DB<3> S ClearCase::Wrapper:For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
DB<4> n
ClearCase::Wrapper::MGi::unlock((eval 303)[blib/lib/ClearCase/Wrapper/
MGi.pm (autosplit into blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):
954]:3):
3:
DB<4> p $?
0
DB<5> S ClearCase::Wrapper:For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
Clearly (!?) I have 'entered' the ForceLock module (even before my run-
time require!), but not have not gone far enough to define and import
the functions there...
It seems to me like the problem is not in the imported module, since
it works from the test script.
As if there was a cycle?
Can you help me make sense of that?
Thanks!
Marc
From an autoloaded function, a require statement succeeds, without
importing any function.
Using the same module works fine from a normal script.
I suspect a problem with my own autoloaded module, or an interaction
of the autoload mechanism.
The code snippet from my autoloaded function:
--8<------
package ClearCase::Wrapper::MGi;
$VERSION = '0.11';
use warnings;
use strict;
use vars qw($ct $eqhl $prhl $diat);
($eqhl, $prhl, $diat) = qw(EqInc PrevInc DelInc);
sub compareincs($$) {
....
}
use AutoLoader 'AUTOLOAD';
use ClearCase::Wrapper;
....
sub unlock() {
my $fl = "ClearCase::Wrapper::ForceLock";
eval "require $fl";
....
--8<------
My test script:
--8<------
#!/usr/bin/perl -w
use ClearCase::Wrapper::ForceLock;
my $lt = 'ZZZ_1.00';
my $v = '/wran_cm_makesystem';
flocklt($lt, $v);
--8<------
Under the debugger, with the latter, I get:
main:./flock:5): my $lt = 'ZZZ_1.00';
DB<1> S ClearCase::Wrapper::ForceLock.*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::ForceLock::flocklt
ClearCase::Wrapper::ForceLock::funlocklt
ClearCase::Wrapper::ForceLock::ssh
Whereas with the former:
o blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):954):
954: eval "require $fl";
DB<3> S ClearCase::Wrapper:For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
DB<4> n
ClearCase::Wrapper::MGi::unlock((eval 303)[blib/lib/ClearCase/Wrapper/
MGi.pm (autosplit into blib/lib/auto/ClearCase/Wrapper/MGi/unlock.al):
954]:3):
3:
DB<4> p $?
0
DB<5> S ClearCase::Wrapper:For|MGi).*
ClearCase::Wrapper::ForceLock::BEGIN
ClearCase::Wrapper::MGi::BEGIN
ClearCase::Wrapper::MGi::compareincs
ClearCase::Wrapper::MGi::unlock
Clearly (!?) I have 'entered' the ForceLock module (even before my run-
time require!), but not have not gone far enough to define and import
the functions there...
It seems to me like the problem is not in the imported module, since
it works from the test script.
As if there was a cycle?
Can you help me make sense of that?
Thanks!
Marc