このページは大阪弁化フィルタによって翻訳生成されたんですわ。

翻訳前ページへ


Damien Learns Perl
The Wayback Machine - http://web.archive.org/web/20110814063821/http://damienlearnsperl.blogspot.com/

Sunday, June 19, 2011

CPAN tester

Tweets from Gabor Szabo got me curious about CPAN tests.
I work in software testing and I recognize the value of automatic tests and reports.
After checking out the CPAN Tester wiki, I installed and configured CPAN::Reporter. If I understand well, this module will automatically send the test results run on your computer to the CPAN test database when you install a new Perl module. The authors and users can see reports on all tested configurations.
This is a simple way to give back to the Perl community for those nice CPAN modules.

The process involved starts with installing the CPAN::Reporter module on your machine and saving the configuration file.
Note: When looking for the metabase-profhttp://www.blogger.com/img/blank.gifile tool on Windows, check in the C:\Perl\cpan\build\Metabase-Fact-0.019\script directory.

You can also set up a machine to continuously test CPAN Perl modules.

Each tester registered to the CPAN gets listed according to the number of test reports sent back to the server. Gabor is making a game of climbing the ranks. Who will join the testers' army and try to beat him?

Edit June 22nd: As of now, I am registered on CPAN testers and have sent my first test report. You can check that your setup is correct by searching through the log tail. Here's my entry:
22T07:21:29Z] [dlp] [pass] [DAGOLDEN/CPAN-Reporter-1.1902.tar.gz] [MSWin32-x86-multi-thread] [perl-v5.10.1] [ddfed1a4-6e1e-1014-9872-6ddfc9b97d9d] [2011-06-22T07:21:29Z]

Let's work our way up!

Digg It! Add to del.icio.us Stumble This

Sunday, January 16, 2011

Modern Perl

Last November, chromatic announced the availability of his book on Modern Perl. His creation is geared towards beginner Perl programmers who want to learn how to use the language in the most effective way, based on experienced programmers' know-how.
The book is also recommended to anyone who wrote Perl scripts in the distant past and wants to take advantage of Perl 5's latest features and good coding practices.
You can download the pdf file from the companion site.


Digg It! Add to del.icio.us Stumble This

Saturday, August 28, 2010

New Android blog!

Hi all!
Just a quick word to tell you about my new blog venture on Android Application programming. DamienLearnsPerl is not dead, just transfixed ;)
Please check out "Do Androids Dream of Google Apps" for the fun!



Digg It! Add to del.icio.us Stumble This

Friday, February 12, 2010

Google AI Challenge: move Perl up the charts!

If you get snowed in this week-end, here's a fun way to pass the time: enter the Google AI challenge!
Organized by the University of Waterloo (Canada) and sponsored by Google, this challenge lets you compete in a game of Tron against other people's algorithms from a wide selection of programming languages.
Sadly, Perl is not widely represented and the highest Perl score is at the 176th rank as of this Friday night.
The contest ends on the 26th of this month. Who will care to test their Perl skills?



Digg It! Add to del.icio.us Stumble This

Tuesday, December 22, 2009

Reentrant perldoc help

Just want to elaborate on a tip that I gave back in March.
I have a somehow standard way of displaying help for my scripts:
I display the POD data using the $0 perl internal variable.
$0 (or $PROGRAM_NAME if you are using the use English; pragma) "contains the name of the file containing the Perl script being executed", to quote the Camel book.

The help section is printed on screen if a script requires a parameter but none has been provided. I used to write it this way for a command line accepting only one parameter:
sub get_help {
system("perldoc $0");
exit;
}
my $arg = $ARGV[0] || &get_help;

However, I recently ran into a slight difficulty.
On Windows, $0 contains the disk letter followed by the complete path and finally the file name. For example:
C:\Users\Damien\Desktop\test coverage\Perl Scripts

Notice the white spaces in the directory names.
When trying to perldoc this particular file name, I would get an error stating that there is no documentation for "C:\Users\Damien\Desktop\test", "coverage\Perl" nor "Scripts".

My first reaction was simply to surround the $0 file name with "" as shown below:
sub get_help {
system("perldoc \"$0\"");
exit;
}
my $arg = $ARGV[0] || &get_help;

[Added Dec. 29th]
However, an enlightened reader pointed me to the best solution:
sub get_help {
system("perldoc", $0);
exit;
}
my $arg = $ARGV[0] || &get_help;

Using the list argument form of the system function avoids relying on the shell to run your command.


Digg It! Add to del.icio.us Stumble This