15 dic. 2011

6 nov. 2011

Stack Overflow - perl questions report

I usually read and answer questions at Stack Overflow. With this post, I start a weekly report of the more relevant perl related questions. Hope it will be interesting for you.

This is the top ten most rated questions at Stack Overflow last week.
Beetwen brackets: question score & answers count
Built date: 2011/11/06 16:02:30 GMT

  1. Simple search and replace without regex - [6/5]
    (2011/11/01 18:00:19 GMT)
  2. How and where can I learn more about the Perl optimizer? - [6/2]
    (2011/11/01 20:13:38 GMT)
  3. Are Perl regexes turing complete? - [6/2]
    (2011/11/02 15:40:12 GMT)
  4. How to plan additional tests run by external sub? - [5/2]
    (2011/11/02 11:52:13 GMT)
  5. Why does print ($a = a..c) produce: 1E0 - [5/3]
    (2011/11/03 23:53:16 GMT)
  6. Replace entire paragraph with another from linux command line - [4/5]
    (2011/10/31 04:32:18 GMT)
  7. Perl shallow syntax check? ie. do not check syntax of imports - [4/4]
    (2011/10/31 14:26:49 GMT)
  8. Infinite loop in perl Carp module - [4/2]
    (2011/11/01 01:00:37 GMT)
  9. Installing perl module: cpan shell vs rpm/deb - [4/2]
    (2011/11/01 10:10:00 GMT)
  10. Reading password protected XLSX on linux (and windows) with Perl - [4/2]
    (2011/11/01 13:31:32 GMT)

22 sept. 2011

Most RxR modules - top 30

The project http://cpanratings.perl.org allows us to rate the perl CPAN modules, and it provides interesting information in terms of starts and comments. You can analyze the stats csv file in order to elaborate new stats. The question I'm trying to answer is this: what's the most rated module? ...

Each line of the CSV file give us the name of the module, the rating (a number between 1 and 5) and the reviews counter. I thought about the list order, which field should I use? After a while, I decided to calculate a new value:

RxR = Rating x Reviews

A simple perl script display the list I was asking for (top 30):

 #                    Module Name Rating Reviews     RxR
== ============================== ====== =======  ======
 1                            DBI    4.7     31    145.7
 2         Spreadsheet-WriteExcel    4.8     26    124.8
 3               Template-Toolkit    4.6     21     96.6
 4               Catalyst-Runtime    4.8     20       96
 5                  Devel-NYTProf    4.9     18     88.2
 6                CGI-Application    4.8     18     86.4
 7                  HTML-Template    4.1     21     86.1
 8                  WWW-Mechanize    4.6     18     82.8
 9                         Dancer    3.5     23     80.5
10                     XML-Simple    4.4     17     74.8
11                     DBD-SQLite    4.6     16     73.6
12                    Devel-Cover    4.9     15     73.5
13                          Moose    4.9     15     73.5
14                      Class-DBI    4.4     16     70.4
15                  App-cpanminus    5.0     13       65
16                       DateTime    4.6     14     64.4
17                   Module-Build    3.2     20       64
18                            ack    4.9     13     63.7
19                     HTML-Mason    4.9     13     63.7
20                            POE    4.9     13     63.7
21                 File-Find-Rule    4.5     14       63
22                    libwww-perl    4.5     14       63
23                     DBD-Oracle    3.7     16     59.2
24                         CGI.pm    4.5     13     58.5
25                     XML-LibXML    4.5     13     58.5
26                         Imager    4.8     12     57.6
27                      MIME-Lite    4.8     12     57.6
28                        XML-RSS    4.1     14     57.4
29                 SQL-Translator    3.9     14     54.6
30                     DBIx-Class    4.9     11     53.9

I named it: The top RxR module list.
Do you know how many modules are rated? 2707 (11% of the whole), and 1700 has only one review.

21 sept. 2011

Perl related blog traffic

I have written only a few posts of perl related topics (about 30). With the new blogger interface, it's easy to check the google analytics and obtain a lot of valuable information. It's interesting the wold map with green colors (dark signals more traffic). These are the country stats of my blog:
My top ten visitors are from:

  1. United States
  2. Spain
  3. Germany
  4. United Kingdom
  5. Russia
  6. Argentina
  7. Canada
  8. Netherlands
  9. Brasil
  10. Australia

I think the blog language it's the first reason that justifies the territory colors. The second place is justified because of my good friends in Spain. But it's interesting to observe that there isn't any traffic from Africa, and others countries like India...

Of course, another reason it's the quality of the contents I wrote, but I imagine that the light colors of the map won't vary too much...

Do you have similar stats you like to share?

19 sept. 2011

Perl Weekly gratitude

I am sure you already know the Perl Weekly newsletter, a great work of Gabor Szabo. If not, please take a look at this url: http://perlweekly.com/.

It's not only an integration work about the news, modules, articles, etc. It also includes excellents comments, which are a great summary of the topics they introduce. I recommend you the suscription.

Every Monday since the project was born, I read the newsletter, and find interesting news and articles. And this morning I saw a link to my article in the "Not Perl" section, Bootstrap && Perl. It was a pleasure  and a surprise. So, thank you Gabor.

My favorite resources to get information about Perl are the following:

  1. http://search.cpan.org/recent
  2. http://ironman.enlightenedperl.org/
  3. http://perlweekly.com/
  4. http://blogs.perl.org/
  5. http://jobs.perl.org
Have you got anyone not listed? please, write down!

Of course, a lot of blogs indexed by enlightnedperl (I don't want to forget anyone, so I don't enumerate them). 

17 sept. 2011

Bootstrap && Perl

I recently found the bootstrap twitter project, which I'm going to use in my projects. Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, layouts, and more.
It also supports javascript, and provide you with some awesome plugins to get you started!
This javascript provides a basic interactive layer on top of the included styles.

Of course, this isn't an only-Perl related topic, but I think it is a very interesting way of improvement for the user interface of any CGI::App, Catalyst, Dancer, Mojolicious, ...  application.

Hope this helps in your next projects.
If you used this tool, it would be nice to hear from you...

15 sept. 2011

Rebecca Perl

Hi, Rebecca
I found your video when I was looking for Perl videos at youtube. Perl is a nice programming language, and a lot of clever people uses it every day. It was invented 24 years ago, probably near to your birthday...
You voice is amazing, this song is awesome... this kind of feelings are the same that we get when we work with Perl. From now on, your songs will go along with my work.
Thanks, Rebecca !


13 sept. 2011

Gearman: framework to farm out work

Gearman provides a generic application framework to farm out work to other machines or processes that are better suited to do the work. It allows you to do work in parallel, to load balance processing, and to call functions between languages.

18 ago. 2011

Perl vs Python debate live from OSCON 2011

An interesting interview between Perl and Python people, I really like this video (OSCON 2011). It was a knights debate, and in my opinion, Perl 1 - Phyton 0. What's yours?

24 abr. 2011

CPAN Module review - Web apps

When I'm developing web applications, I use those frameworks that make my work easier. The size of the webs is not big and I have been working with CGI::Application for years. In a recent search, I have found Dancer. This framework handles the routes concept (an idea from Ruby's Sinatra); routes are paths which are binded to code. For example:

get '/home' => sub { 'Hi, this is home!' };

There are a lot of plugins available (database, logging, session handling, REST, AJAX, validation, templates, WebSocket, ...) at CPAN. You can write your own plugin by subclassing Dancer::Plugin.

The framework comes with a script that builds the skeleton of your application, with a nice structure in folders: views, libs, ... it takes seconds to start a new application.

I  definitely recommend Dancer to you. Just install and try!

21 abr. 2011

Perl 5.14 - favourite features

Perl 5.14 is near to be released, and RC1 is out. I'm reading the perldeltas documents looking for nice features. First of all, I'd like to send my congratulations to this fantastic team of people who has done it possible.
Since Perl 5.13.6 (documentation), you can now use the keys, values, each builtin functions on arrays (previously you could only use them on hashes). In fact, this feature is available in Perl 5.12, but it was not documented in perldelta, and I'm using it now.

15 abr. 2011

CPAN Module review - Exceptions

I would like to share with you those modules that I use when I perform come kind of tasks. I start this series with exception handling. And the "winner" is... Try::Tiny !
  • nice / sugar syntax
  • Devel::Declare based (no source filters)
  • simple
What's your favorite alternative?