I need to know if this practice for using modules fine or not:
MyApp.pm
package MyApp;
use Moose;
use MyApp::View;
use MyApp::Config;
sub view {
return MyApp::View->new;
}
sub config {
return MyApp::Config->new;
}
MyApp/View.pm
package MyApp::View;
use Moose;
extends qw(MyApp);
sub render {
}
MyApp/Config.pm
package MyApp::Config;
use Moose;
extends qw(MyApp);
sub get {
}
App.cgi
#App.cgi
use Moose;
extends qw(MyApp);
my $view = MyApp->view();
my $config = MyApp->config();
....
I am confused since I used "use MyApp::View" in MyApp then used "extends qw(MyApp);" in Config module. Is that considered bad cyclic?.
The idea about this I want to share all methods and variable in the MyApp module with the View and Config modules in the same instance in App.cgi.