[Dancer-users] Modular approach without anonymous subrefs

gvim gvimrc at gmail.com
Sun Sep 23 02:27:06 CEST 2012


I'm converting a CGI::Application web app to Dancer and have always used a modular approach so am I missing something if I prefer to do it this way:

package MyApp;

use Dancer qw(:syntax);
use Login;
use Logout;
use Register;

post '/login'        => \&Login::run;
post '/logout'       => \&Logout::run;
get   '/register'     => \&Register::run;
1;


package Register;
use Dancer qw(:syntax);
sub run {
   .....
}
1;

package Login;
use Dancer qw(:syntax);
sub run {
   .....
}
1;

?

gvim




More information about the Dancer-users mailing list