'Working on an inherited object oriented Perl application. I can't post code, so I'll try to describe the situation. The application has about 70+ custom modules (classes). This application was developed on Windows and runs without complaint there. Recently, I've been tasked with making it work on Linux. It runs now. But, at compile time (or very early run time), it produces a series of complaints saying:
For the file, fileA.pm, each of the about 20 subroutines produce a line like above.
I think I see what is going on, but, I don't know how to tell where it is. There are lots of dependencies between the 70+ "*.pm" files.
When the app starts up, a 'use' statement pulls in fileA.pm which has some 'use' statements, one of which pulls in fileB.pm. FileB.pm, in turn, has 'use' statements that refer to fileC.pm. Which, in turn, has 'use' statements one of which uses fileA.pm. Note 'fileA.pm' has been 'used' twice. This daisy chain of 'use' statements bites it own tail.
So fileA.pm starts and then the 'use' goes to pick up, fileB.pm, which starts to compile, but, then goes to pick up fileC.pm which starts to compile, but, points back to fileA.pm. This second call to fileA.pm compiles and the sub routines with their namespaces are loaded. Control falls back to fileC.pm which completes loading, then back to fileB.pm and finally back to fileA.pm. Since the namespaces/subroutine names are already loaded for fileA.pm, I get the 'Subroutine SomeSubNameHere redefined...' complaint.
So, I see what is going on. But, I only know one of the 70+ files that is actually involved in the loop. There may be as few as two files. Possibly many more. :-/
My question, does anyone know how to track the compile process to see which files are involved and when? I need to figure out the sequence of the module loading. What path does the daisy chain follow?
If there were 4 or 5 modules, this would be a quick problem. But, with 70+ "*.pm" files, many of which contain multiple packages, many of which refer back and forth to each other, tracking this down is a pain. I need it to take hours, not days.
Thanks,
John
Does any of this makes sense? ;-/
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
Code:
Subroutine SomeSubNameHere redefined at /path/to/fileA.pm line ##1.
Subroutine secondSubNameHere redefined at /path/to/fileA.pm line ##2.
Subroutine aThirdSubNameHere redefined at /path/to/fileA.pm line ##3.
For the file, fileA.pm, each of the about 20 subroutines produce a line like above.
I think I see what is going on, but, I don't know how to tell where it is. There are lots of dependencies between the 70+ "*.pm" files.
When the app starts up, a 'use' statement pulls in fileA.pm which has some 'use' statements, one of which pulls in fileB.pm. FileB.pm, in turn, has 'use' statements that refer to fileC.pm. Which, in turn, has 'use' statements one of which uses fileA.pm. Note 'fileA.pm' has been 'used' twice. This daisy chain of 'use' statements bites it own tail.
So fileA.pm starts and then the 'use' goes to pick up, fileB.pm, which starts to compile, but, then goes to pick up fileC.pm which starts to compile, but, points back to fileA.pm. This second call to fileA.pm compiles and the sub routines with their namespaces are loaded. Control falls back to fileC.pm which completes loading, then back to fileB.pm and finally back to fileA.pm. Since the namespaces/subroutine names are already loaded for fileA.pm, I get the 'Subroutine SomeSubNameHere redefined...' complaint.
So, I see what is going on. But, I only know one of the 70+ files that is actually involved in the loop. There may be as few as two files. Possibly many more. :-/
My question, does anyone know how to track the compile process to see which files are involved and when? I need to figure out the sequence of the module loading. What path does the daisy chain follow?
If there were 4 or 5 modules, this would be a quick problem. But, with 70+ "*.pm" files, many of which contain multiple packages, many of which refer back and forth to each other, tracking this down is a pain. I need it to take hours, not days.
Thanks,
John
Does any of this makes sense? ;-/
'hope this helps
If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.