Posts Tagged ‘cpan’

Perl 5.10.1 released

Sunday, August 23rd, 2009

Perl 5.10.1 have been released. You can download it from the CPAN, or if you can’t wait, here.

Next, you need to build it:

mkdir ~/perl/5.10.1
cd ~/code/build/perl-5.10.1
perl Configure -de -Dprefix=${HOME}/perl/5.10.1/
make
make test
make install

Add the path to your environment

export PATH=${HOME}/perl/5.10.1/bin:$PATH

and install your CPAN’s modules:

PERL_MM_USE_DEFAULT=1 cpan Bundle::CPANxxl Task::Kensho

Now you can start to play with it :)

cpan-explorer update and three new maps

Tuesday, July 28th, 2009

The site cpan-explorer have been update with three new maps for the YAPC::EU. This three maps are different from the previous one. This time, instead of having a big photography of the distributions and authors on the CPAN, Task::Kensho have been used to obtain a representation of what we call the modern Perl.

distributions map

moosedist
Task::Kensho acted as the seed for this map. Task::Kensho contains a list of modules recommended to do modern Perl development. So we extracted the modules that have a dependancie toward one of these modules, and create the graph with this data.

authors map

The authors listed on this map are the one from the previous map. There is a far less authors thant the previous authors map, but it’s more readable. A lot of informations are on the map : label size, node size, edge size, color of the node.

web communities map

This map look a lot like the previous one, as we used nearly the same data. The seed have been extended with a few websites only.

cpan-explorer

cpan-explorer is now hosted on a wordpress, so you can leave comments or suggestions for new maps you would like to see (a focus on web development modules, tests::* module, etc …). All the new maps are also searchable, and give you a permalink for you search (I’m here and here).

I will give a talk at the YAPC::EU about this work. Also, each map have been printed, and will be given for the auction.

This work is a collective effort from all the guys at RTGI (antonin created the template for wordpress, niko the js and the tools to extract information from the SVG for the searchable map, julian helped me to create the graphs and extract valuable informations, and I got a lot of feedback from others coworkers), thanks guys!.

CPANHQ and dependencies graph

Thursday, July 16th, 2009

CPANHQ is a new project that “aims to be a community-driven, meta-data-enhanced alternative to such sites as http://search.cpan.org/ and http://kobesearch.cpan.org/“.

I believe that a good vizualisation can help to have a better understanding of datas. One of the missing thing on the actual search.cpan.org is the lack of informations about a distribution’s dependencies. So my first contribution to the CPANHQ project was to add such informations.

cpanhq-dep

For each distributions, a graph is generated for the this distribution. For this, I use Graph::Easy and data available from the CPANHQ database. I alsa include a simple list of the dependencies after the graph.

Only the first level dependencies are displayed, as the distribution’s metadata are analysed when the request is made. I could follow all the dependencies when the request is made, but for some distribution it could take a really long time, and it’s not suitable for this kind of services.

edit: you can found CPANHQ here : CPANHQ on github

everyday Perl : CPAN and auto-install

Tuesday, July 7th, 2009

When you install a module from the CPAN, and this module requires other modules, the cpan shell will ask you if you want to install them. When you are installing Catalyst, it may take a while, and you may not want to spend your afternoon in front of the prompt answering “yes” every 5 seconds.

The solution is to set the environment variable PERL_MM_USE_DEFAULT. Next time you want to install a big app:

PERL_MM_USE_DEFAULT=1 cpan Catalyst KiokuDB

and your done.

modules I like : Module::Setup

Friday, May 22nd, 2009

Module::Setup by Yappo is a really nice module. I don’t like Module::Starter, it’s not easy to create template to make it do what you need. With Module::Setup you can create flavors for any type of modules you want. Most of the modules I create for work use Moose, and I like to use Test::Class too. I’ve created a Moose flavor for creating this kind of modules.

Creating a Moose flavor for Module::Setup

First, you tell it to init a new flavor:

module-setup --init moose

Module::Setup ask what is your favorite SCM. For me, it’s git. It will create files in $HOME/.module-setup/flavors/moose/.

Start by editing $HOME/.module-setup/flavors/moose/template/lib/____var-module_path-var____.pm to make it look like this

- use strict;
- use warnings;
+ use Moose;

Add requires 'Moose' in Makefile.PL. Create a t/tests/Test/____var-module_path-var____.pm file with the following content:

package Test::[% module %];
 
use strict;
use warnings;
use base 'Test::Class';
use Test::Exception;
use Test::More;
 
sub class { '[% module %]' }
 
sub startup : Tests(startup => 1) {
    my $test = shift;
    use_ok $test->class, "use ok";
}
 
sub shutdown : Tests(shutdown) {
    my $test = shift;
}
 
sub constructor : Tests(1) {
    my $test = shift;
    can_ok $test->class, 'new';
}
 
1;

You will have a Test::Class test ready with basic tests already implemented.

If you want to share this template at $work, easy:

module-setup --pack DevMoose moose > DevMoose.pm

You just have to send DevMoose.pm to who need it, and he will be able to import it with

module-setup --init --flavor-class=+DevMoose moose

Now you can create a new module

module-setup MY::AWESOME::MODULE moose