RSS

Tag Archives: perlbrew

perlbrew and mojolicious

I’m not a fan of the guys over at mojo but it’s probably the better of the Perl micro-webframeworks out there. So I was curious if mojolicious was going to work with perlbrew.

The first thing I did was install perlbrew. There are several ways to do it. I decided upon the first option:

curl -Lk http://xrl.us/perlbrewinstall | bash

What I do not like about the above command is that the code is assumed to be good and safe. It would have been a little more helpful of the code were downloaded from CPAN.

Once the module was installed. I was directed to add a line to my .bash_profile and then restart my terminal session. Easy enough.

NOTE: I did not recall what the base version was so I edited the .bash_profile file again and commented out the line that I was instructed to include. Then I opened a new terminal session and executed the command:

perl -v

My default/host perl version was 5.12.3. And I wanted to install perl 5.16.0 the latest and current version of perl:

perlbrew install 5.16.0

Easy enough! At this point there was a message on the console that suggested a tail command that I could use to monitor the build. That was easy too. In the end it took about an hour or so and I had a working Perl 5.16.0. (feel the perlbrew doc for the interesting commands)

As a last step I wanted to see what was going to happen when I installed mojolicious, could it be installed in userspace, and which version was it doing to use. So I installed mojo:

curl -L cpanmin.us | perl - Mojolicious

I omitted the ‘sudo’ that the mojo guys recommended and it installed fine. But now the proof needed to be in the pudding. I created a hello.pl file:

use Mojolicious::Lite;
get '/' => {text => 'Hello World! ' . $] };
app->start;

Notice that I added the $] to the message. This is going to append the Perl version number to the end of the hello world string. The good news is that when I ran the application:

morbo hello.pl

and launched my browser, I received a message that told me I was using Perl version 5.16.0. Perlbrew was a success and so was Mojo.

 
10 Comments

Posted by on 2012/05/26 in Tools, web

 

Tags: , ,

Another killer app for Perl

I’ve written about perldoc and CPAN as being Perl’s killer apps. I’ve also written about Ruby’s RVM and Python’s Virtualenv. Now I get to write about Perl’s perlbrew.

I’ve been tweeting(@rbucker) with a couple of techies today s a result of a comment that one of the made. Something to the effect that virtualenv was going to be made a core python app. Suggesting that it was going to be rolled into the distro.

If you’ve been around a while and you have a little intuition… it should be going off at this very moment. I’m not going to go into the high level discussion that I had with these guys nor am I going to go into the micro details. What I will say, in summary, is that this is a very bad idea and as a result virtualenv should become very unstable as a result.

Which got me thinking about Ruby and Perl. On the one hand I know that Ruby has RVM but is there something for Perl? Yep! As I write this article I have installed perlbrew and I’m installing Perl 5.16.0 at this very moment.

I do not know anything about perlbrew at this point other than it seems to be installing Perl properly and in userspace where I want it. If all goes well and I have the required prerequisites all should be well in the next little while. I really like Perl and Python. The idea of dumping Python feel like jumping the shark. Perl-6 and Python-3 feel unnatural at the moment. I’m just hopeful that virtualenv and perlbrew can keep my world glued together until the rest shakes out.

 
 

Tags: , , , , ,

 
One Page Docs

Creating a library one page at a time.

One Page Bugs

Reducing the friction of writing and fixing bugs or features.

Follow

Get every new post delivered to your Inbox.

Join 223 other followers