문제

I have seen that post about a similar question, but the replies did not allow me to understand the process. AFAIK, Perl is not a compiled language. It does not make sense I would have to put all my code into a single app file... OK, I also must confess I am not a Heroku buildpack expert.

My issue is really simple: I have coded a Mojolicious application, my Perloku setup is working well, I am happy except I do not understand how to package my own Perl module into my app. And I can't trust there is no way of achieving this.

Could anyone give me advice about what I should do?

도움이 되었습니까?

해결책

I use Heroku, Perloku and Mojolicious for my personal website. I have a couple very basic modules I wrote to connect to the database and run single query.

https://github.com/elmoren/perl-mojo-heroku

I use the full size Mojolicious App. I put all my .pm files in the lib directory. Then in my Mojolicious app file lib/NJEApp.pm:

use lib 'lib';
use Projects; # This is a basic module that runs a single database query. 

In the script/StartApp.pl. This file is called by the Perloku file in the top level directory.

use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/../lib";
use Mojolicious::Commands;

#~ Start the Commands for the Application
Mojolicious::Commands->start_app('NJEApp');

For external modules, you can put them in the Makefile.PL in the PREREQ_PM = {} section

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top