mojolicious Archives

Diagnosing module installation problems in Heroku

I've been playing with Heroku (a platform as a service) and Mojolicious, which works very well if all of the modules install. Greg Hinkle shows you how to do it. Create your mojo app and deploy it easily to Heroku. As you do, it's dependencies are installed for you.

Pure Perl modules are usually fine, but Heroku is a limited Ubuntu environment that doesn't have all the libraries you probably expect to already be there. One of the modules I needed had DB_File as a deep dependency, so deploying my app (with Heroku toolbelt and Mojolicious::Command::deploy::heroku) fails. I get the rainbow barf from the uni-raptor.

barfing-raptor.png

Painless RSS processing with Mojo

I wasn't looking forward to dealing with this XML feed because I hate anything that deals with XML. However, with Mojo's DOM stuff, I don't even have to know it's XML. Here's the interesting bits from a program that's not much larger than this snippet:

use Mojo::UserAgent;

my $ua = Mojo::UserAgent->new;
my $response = $ua->get( $feed_address )->res;

my @links = $response->
dom( 'item' )->
grep( sub { $_->children( 'title' ) !~ /.../ } )->
map( sub {
$_->
children('guid')->
map( su…

About brian d foy

user-pic I'm the author of Mastering Perl, and the co-author of Learning Perl (6th Edition), Intermediate Perl, Programming Perl (4th Edition) and Effective Perl Programming (2nd Edition).