Implement CLI application by editing main.pl.
You may add new files to keep your code clean, if it is allowed in your challenge.
In main.pl, there is a function called main
, which receives command line arguments as-is.
sub main {
# code to run ...
}
main(@ARGV);
You can use the standard print()
method to output results to standard output.
print("text to output");
To install external libraries, write dependencies in cpanfile. Dependencies will be install by using Carton.
Following sample from cpanfile has been verified to installs dependencies as expected.
requires 'Plack', '1.0'; # 1.0 or newer
requires 'JSON', '>= 2.00, < 2.80';
recommends 'JSON::XS', '2.0';
conflicts 'JSON', '< 1.0';
on 'test' => sub {
requires 'Test::More', '>= 0.96, < 2.0';
recommends 'Test::TCP', '1.12';
};
on 'develop' => sub {
recommends 'Devel::NYTProf';
};
feature 'sqlite', 'SQLite support' => sub {
recommends 'DBD::SQLite';
};