Reading Mojolicious minions documentation I found the following code:
use v5.28;
use Mojolicious::Lite;
use experimental qw( signatures );
use Time::HiRes qw( time );
plugin Minion => {
SQLite => 'sqlite:' . app->home->child('minion.db'),
};
# ...
app->start;
How did they create a new syntax plugin Minion => {...}
? I've never seen it in classic Perl books. Is it a function call with a hash parameter: "Minion" being a key and a hashref {...}
is a value?
Also they call app->start
- app
is a function returning a blessed hashref? But if it was a hash why "start" is not enclosed into braces? This syntax looks strange to me.