package Foo;
no circular::loading;
# ...
1;
This is a rather simple module. You use
it at the top of your file right
after your package declaration (this is important). It will throw an error
including a stacktrace if the package is required again without having been
fully compiled. It does that by deferring the entry in %INC
that usually
happens at load time until the end of compilation time with the help of
B::Hooks::EndOfScope.
The package's %INC
entry will not be available until after compile time.
This means the package won't be seen as loaded by the packages use
d after
no circular::loading
.
Another non-nicety is that you'll have to put the no circular::loading
declaration first in your package as to not import from other packages
multiple times. This might not break anything, but it might hide the real
circular error from you.
This is the method called when
no circular:loading;
is used. There is no corresponding import
method at the moment.