I am aware of cyclic module dependency in perl and the fact that it is very bad idea e.g.:
package ModuleA;
use ModuleB;
package ModuleB;
use ModuleA;
I want to ask if following model is safe and if it follows some best practicing rules:
package main;
use ModuleA;
use ModuleB;
package ModuleA;
use ModuleB;
use ModuleC;
package ModuleB;
use ModuleC;
Also I would like to ask if the order of use-ing modules have any impact? e.g. if
package main;
use ModuleA;
use ModuleB;
is the same as
package main;
use ModuleB;
use ModuleA;
and if
package ModuleA;
use ModuleB;
use ModuleC;
is the same as
package ModuleA;
use ModuleC;
use ModuleB;
etc.
EDIT: Note to say that ModuleA loads ModuleC explicitly (and do not rely on ModuleB that it will load ModuleC) because ModuleA uses functions from ModuleC. Is this good design approach?
use=require+import. OO modules usually have noimport, non-Exporter modules might have a wildimport.import". Also when you have dependency as I mentioned (and also satisfied condition that needed modules are loaded explicitly e.g. ModuleA loads ModuleC explicitly and do not rely on ModuleB that it will load ModuleC) is it OK or is it some signal that the script should be redesigned to object oriented or functional or something?