Frequently asked questions

How does Catalyst compare with Ruby on Rails?

See http://www.wikivs.com/wiki/Catalyst_vs_Ruby_on_Rails

What are the recommended modules to use with Catalyst for various tasks?

How do I use Unicode in my Catalyst application?

See Using Unicode

How should I ship/package my Catalyst application?

If you ship a tarball with your Catalyst app and a local::lib, all your customers need is perl.

How can I profile Catalyst code running in a fcgi environment using the -d perl profilers like Devel::NYTProf?

Fire a FastCGI kid up against the socket using perl -d

How do I have my application e-mail me whenever there is an error?

  • For higher-level errors, create a root end action that catches $c->error and emails if it is populated
  • To catch any error, including warnings, make a $SIG{__WARN__} handler

How do I automatically create schema files for my database?

See http://search.cpan.org/~ilmari/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader.pm#make_schema_at:

perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib -e 'make_schema_at("MyApp::Schema::MySchemaName", 
{ debug => 1, db_schema => "myschemaname" }, 
[ "dbi:Pg:host=localhost;dbname=mydbname", "user", "pass" ])'

What does the error screen below mean?

(en) Please come back later
(fr) SVP veuillez revenir plus tard
(de) Bitte versuchen sie es spaeter nocheinmal
(at) Konnten's bitt'schoen spaeter nochmal reinschauen
(no) Vennligst prov igjen senere
(dk) Venligst prov igen senere
(pl) Prosze sprobowac pozniej

It means an exception has occurred but debugging was disabled. Check the application error log for details. The error log may be stored in the server's error log, or if you followed deployment guidelines similar to those for lighttpd, it will be stored in a separate file.

You may also deliver a custom error message in this case, please see: Delivering a Custom Error Page

My new style myapp.conf isn't read, why?

Install Config::General. Try: cpan Config::General

How do I hide certain variables (e.g. user/password) from the debug screen?

Q: I want to send someone the URL to myapp failing to get help with the error, but the debug screen shows the username and password to connect to my DB. How do I disable that?

A: In MyApp.pm, override $c->dump_these, which controls the variables to dump in the debug screen:

sub dump_these {
    my $c = shift;
    my @variables = $c->SUPER::dump_these();
    return grep { $_->[0] ne 'Config' } @variables;
}

Why do I get Caught exception in MyApp::Controller::Root->end "Catalyst::Action::RenderView could not find a view to forward to."?

Create a view using the myapp_create.pl view helper.

How can I access $c->cache from a script?

Why does apache and fastcgi complain that it can't find my .tt2 files? (non-windows)

Try running the development server. If the templates render you most likely have a permissions problem that is preventing the apache user from accessing your template files. Remember, the development server is run as yourself (the user you are logged in as) so permission problems may not be apparent until you roll out your site.

My tags:
 
Popular tags:
 
Powered by Catalyst