Perl Advent Calendar 2017 - Mojolicious on the Command Line
Mojolicious provides a utility class, ojo, that allows us to leverage the power of Mojolicious from the command line:
perl -Mojo -E 'say g("http://goo.gl/EsGk3b")->text'
The -M flag tells perl to load the following module, so -Mojo, despite looking like a super secret Mojo flag to perl actually is a cheeky way of saying use ojo.
ojo provides a whole host of single letter functions that are shortcuts to Mojolicious utilities, allowing you to quickly do things like fetching urls, reading and writing files, encoding and decoding json, manipulating data structures and a whole host more.
August 1, 2018 at 9:47:04 AM EDT
*
FILLER