I created my mojolicious-lite app on my own(just created files I needed manually instead of using the "create app" commands). I am following along with the tutorial here: https://www.perl.com/article/193/2015/9/18/How-to-send-verification-emails-using-Mojolicious/
When trying to use any command line commands with my app I am getting errors. From the tutorial specifically I am trying to run:
./hello.pl minion job
But more generally I also notice no commands seem to be working for me e.g:
./hello.pl help
./hello.pl routes
The error seems to be with parsing of my postgres helper? Here is the exact error message:
./hello.pl help
./hello.pl: line 1: use: command not found
./hello.pl: line 2: use: command not found
./hello.pl: line 3: use: command not found
./hello.pl: line 4: use: command not found
./hello.pl: line 5: use: command not found
./hello.pl: line 6: use: command not found
./hello.pl: line 7: use: command not found
./hello.pl: line 10: syntax error near unexpected token `('
./hello.pl: line 10: `helper pg => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test_users') };'
My app is working fine other than invoking commands from the command line.
Here are the first 11 lines of my app:
use Mojolicious::Lite;
use Mojo::ByteStream;
use Mojo::JWT;
use Mojo::Pg;
use Mojolicious::Plugin::Bcrypt;
use Mojolicious::Plugin::Minion;
use Data::Dumper;
helper pg => sub { state $pg = Mojo::Pg->new('postgresql://postgres@/test_users') };
app->pg->migrations->from_data->migrate;