Subject: | die if Text::CSV cannot be instantiated. |
I passed an encoding => utf8 option into the config for Catalyst::View::CSV erroneously. This caused Text::CSV constructor to die, but my Catalyst app happily started until I tried to forward to the CSV view, in which case it mysteriously died when trying to access $csv in process function. $csv was undefined, since the constructor failed.
Suggest:
my $csv = Text::CSV->new ( $config )
or die "Cannot use CSV View: ".Text::CSV->error_diag ();
$self->csv ( $csv );
in the new method.
Setting auto_diag in Text::CSV at least prints something upon start, but seems like app should not start if a View failed to instantiate.
Thanks,
\- Mike
$ perl -MCatalyst::View::CSV\ 999
Catalyst::View::CSV version 999 required--this is only version 1.5.
BEGIN failed--compilation aborted.