When people tell me that I can't (they mean shouldn't) parse HTML with a regex, I say "hold my beer". It isn't a matter of skill or attitude so much as convenience. Doing it the right way was not always so easy (I remember HTML 0.9 being a big deal). Lately, though, I've been using Mojo::DOM to do it for me. It's easier than the old, expedient way.
Create new, complex Promises by composing Promises
Mojolicious 7.49 added an its own implementation of the Promises/A+ specification. mohawk wrote about these in Day 14: You Promised To Call! of the 2017 Mojolicious Advent Calender where he showed you how to fetch many webpages concurrently. This Advent entry extends that with more Promise tricks.
Developing webapps with Mojolicious is a lot of fun!
morbo server for
development, every change to my webapp causes a restart to load my changes.
This way the next request I make has all my new code!
So, I change my code, the webapp restarts, and I go back to my browser window. Wait... Where's my new code? Why isn't the bug fixed? Did... Did I forget to reload my browser window again? Ugh! Of course!
Does this happen to you? Probably not. But, it's still annoying to reload the browser window after every backend code change. It'd be nice if my browser window automatically reloaded every time the web server restarted!
Welcome to another year of the Mojolicious Advent Calendar! 2018 has been very good to Mojolicious and I could think of no better way to kick off this calendar than with a recap of the 2018 Nordic Perl Workshop and MojoConf held in Oslo, Norway.