If you’re getting the “Can’t locate Catalyst/Engine/HTTP/Restarter.pm” error message, it is very likely you’re running a recent version of Catalyst:
Can't locate Catalyst/Engine/HTTP/Restarter.pm in @INC (@INC contains: /home/jason/catalyst-book-code/Chapter_3/LolCatalyst-Lite/script/../lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .). at /usr/lib/perl5/Class/MOP.pm line 116 Class::MOP::load_first_existing_class('Catalyst::Engine::HTTP::Restarter') called at /usr/lib/perl5/Class/MOP.pm line 121 Class::MOP::load_class('Catalyst::Engine::HTTP::Restarter') called at /usr/share/perl5/Catalyst.pm line 2634 Catalyst::setup_engine('LolCatalyst::Lite', undef) called at /usr/share/perl5/Catalyst.pm line 1081 Catalyst::setup('LolCatalyst::Lite') called at /home/jason/catalyst-book-code/Chapter_3/LolCatalyst-Lite/script/../lib/LolCatalyst/Lite.pm line 34 require LolCatalyst/Lite.pm called at script/lolcatalyst_lite_server.pl line 55 Compilation failed in require at script/lolcatalyst_lite_server.pl line 55.
The problem is that Catalyst::Engine::HTTP::Restarter within Catalyst::Engine was replaced by Catalyst::Restarter within the Catalyst::Devel package. How to fix your application to use the updated development web server? Very easy. Rerun catalyst.pl with the “-scripts”, to rebuild just the scripts in the script directory, and “-force” to overwrite any files therein:
catalyst.pl -scripts -force LolCatalyst::Lite
exists "LolCatalyst-Lite/script/lolcatalyst_lite_cgi.pl" created "LolCatalyst-Lite/script/lolcatalyst_lite_cgi.pl" exists "LolCatalyst-Lite/script/lolcatalyst_lite_fastcgi.pl" created "LolCatalyst-Lite/script/lolcatalyst_lite_fastcgi.pl" exists "LolCatalyst-Lite/script/lolcatalyst_lite_server.pl" created "LolCatalyst-Lite/script/lolcatalyst_lite_server.pl" exists "LolCatalyst-Lite/script/lolcatalyst_lite_test.pl" created "LolCatalyst-Lite/script/lolcatalyst_lite_test.pl" exists "LolCatalyst-Lite/script/lolcatalyst_lite_create.pl" created "LolCatalyst-Lite/script/lolcatalyst_lite_create.pl"
If you’re interested in learning the Catalyst Web Framework (Perl based), I highly recommend The Definitive Guide to Catalyst: Writing Extensible, Scalable and Maintainable Perl–Based Web Applications.