• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Perl Advent Calendar 2017 - Mojolicious on the Command Line

QRCode

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.

http://perladvent.org/2017/2017-12-15.html
August 1, 2018 at 9:47:04 AM EDT *
perl mojolicious
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community