M
max.gruber
Suppose I've got a subroutine subA in PackageA which calls subB from
PackageB.
Now somehow I keep getting "Undefined subroutine &PackageB::subB
called at PackageA line n" (line number points to subA) depending on
from where I call subA.
For example, I can call subA from a subroutine in PackageC without
getting any error, but when I call subA from another subroutine in
PackageA, the error will appear. PackageA has a use statement for
PackageB and PackageB will export subB automatically. PackageC doesn't
have a use statement for PackageB.
When I dump the symbol table %:: just before the call to subB, in all
cases where the error appears, it will actually contain a reference to
subB. In all cases where the error doesn't appear, it won't contain a
reference. (WTF?)
Calling subB with its full name (PackageB::subB()) will always work,
by the way. But I'd rather understand why it won't work without the
package name.
Hope that was more or less understandable.
I have absolutely no idea where to go from here. I'm utterly confused
and would appreciate any hints on how to solve this.
Regards,
Max
PackageB.
Now somehow I keep getting "Undefined subroutine &PackageB::subB
called at PackageA line n" (line number points to subA) depending on
from where I call subA.
For example, I can call subA from a subroutine in PackageC without
getting any error, but when I call subA from another subroutine in
PackageA, the error will appear. PackageA has a use statement for
PackageB and PackageB will export subB automatically. PackageC doesn't
have a use statement for PackageB.
When I dump the symbol table %:: just before the call to subB, in all
cases where the error appears, it will actually contain a reference to
subB. In all cases where the error doesn't appear, it won't contain a
reference. (WTF?)
Calling subB with its full name (PackageB::subB()) will always work,
by the way. But I'd rather understand why it won't work without the
package name.
Hope that was more or less understandable.
I have absolutely no idea where to go from here. I'm utterly confused
and would appreciate any hints on how to solve this.
Regards,
Max