For quick-and-dirty solution try adding use lib '/path/to/kraih-mojo-97e88d1/lib';
statement to your my_app
script and run command as
perl my_app/script/my_app my_command
Question
I need to call my own mojolicious command from command line, using specific mojolicius intallation (System version of mojolicius is too old, and I can't update it). How can I do this?
something like:
$ ./kraih-mojo-97e88d1/script/mojo my_app/script/my_app my_command
will be great!
Solution
For quick-and-dirty solution try adding use lib '/path/to/kraih-mojo-97e88d1/lib';
statement to your my_app
script and run command as
perl my_app/script/my_app my_command
OTHER TIPS
If you want to do a similar thing to the answer by melhesedek, but without changing your code, try using the -I
switch to the perl
interpreter:
perl -I/path/to/kraih-mojo-97e88d1/lib my_app/script/my_app my_command
or you can use the PERL5LIB
environment variable, which you could set in your local environment, or prefix the command, like so:
PERL5LIB=/path/to/kraih-mojo-97e88d1/lib ./my_app/script/my_app my_command
Also, I personally believe that the lib
module is too magical for my taste. It's not readily apparent in every-day use, but it should NEVER be used in say CPAN code. Just fyi.