Opened 8 years ago

#29 new enhancement

Bootstrap local::lib and Mojolicious for Bearmail

Reported by: Vincent Caron Owned by: Vincent Caron
Priority: major Component: Bearmail
Keywords: Cc: Benjamin Linet

Description

I've pushed a simple solution to manage Perl dependencies : source:/bearmail/perl-env

It works like Python's virtualenv. Any CPAN module is automatically installed to the local lib/perl5 hierarchy and used from there (libs loaded by 'use ...;'). Same with programs invoked from the shell, tried in the local bin/ first.

As for Mojolicious, I recommend it since it's very well maintained and self contained. Its only dependency is... Perl !

Thus you're ready to go in 1 minute :

$ source perl-env
$ cpanminus Mojolicious
$ cat >hello.pl
use Mojolicious::Lite;
get '/' => {text => 'Hello World!'};
app->start;
(Ctrl+D)
$ morbo hello.pl

Very cool !

Note that modules are now searched from lib/perl5. For instance use Bearmail::Foo; will implicitly search for lib/perl5/Bearmail/Foo.pm.

I've not moved existing Bearmail modules from lib/ to lib/perl5 because we know we'll have to rewrite or at least refactor a large part of them.

Next step : create a minimal app with the login page, then (fake) login mechanism.

Change History (0)

Note: See TracTickets for help on using tickets.