[Dancer-users] Dancer::Session::SQLite

Alexis Sukrieh sukria at sukria.net
Tue Aug 24 08:33:09 CEST 2010


On 24/08/2010 08:14, P Kishor wrote:
> Using Dancer::Session::YAML and Dancer::Session::Storable as
> templates, I created a Dancer::Session::SQLite module. I put it in
> /usr/local/lib/perl5/site_perl/5.12.1/Dancer/Session/SQLite.pm and set
> session =>  'SQLite'. Yet, I get an error saying 'Error while loading
> /Users/punkish/Sites/lca/app.psgi: unknown session engine 'SQLite',
> perhaps you need to install Dancer::Session::SQLite? at
> /usr/local/lib/perl5/site_perl/5.12.1/Dancer/Engine.pm'

When Dancer parses your config file, it uses Dancer::ModuleLoader to 
load the session engine you chose. Hence it does internally a `use 
Dancer::Session::SQLite'.

The error message you report tends to show that Dancer::Session::SQLite 
is not in @INC (or the use fails for another reason).

First, I'd suggest to do the following to test your module without 
installing it:

   YourApp/
     ...
     lib/
       YourApp.pm
       YourApp/
       Dancer/
         Session/
           SQLite.pm

Then try to do the following:

$ perl -Ilib -MDancer::Session::SQLite -e 'print 1, "\n"'

Maybe you'll see here the source of the error.

When you're happy with it, I suggest you create a real CPAN distribution 
(with Module::Starter). I'm sure other Dancer users could find 
Dancer::Session::SQLite interesting.

Good luck.

-- 
Alexis


More information about the Dancer-users mailing list