This is not the best refactor in the world. Catalyst is complaining that we are doing routing in the app itself, instead of using a root controller. Because this app uses some global variables, I'm creating a new root controller class, but keeping it in the same .pm file. The ::App class is perhaps confusingly not the web app but the command line app, allowing the script and the test to get things started without having to directly use the $ebug global variable, which is now my. Since we are already putting multiple classes in one .pm file lets just do the bad thing across the board and put the view in there too, since it is just a few lines.
This is not the best refactor in the world. Catalyst is complaining that we are doing routing in the app itself, instead of using a root controller. Because this app uses some global variables, I'm creating a new root controller class, but keeping it in the same .pm file. The ::App class is perhaps confusingly not the web app but the command line app, allowing the script and the test to get things started without having to directly use the
$ebug
global variable, which is nowmy
. Since we are already putting multiple classes in one .pm file lets just do the bad thing across the board and put the view in there too, since it is just a few lines.