Pod::Readme v1.0.2 released
I released a new version of Pod::Readme yesterday. It's a module for "Intelligently generate a README file from POD" by using POD =begin/=end and =for commands to control what parts of a module's POD are included/excluded in the README. For example, you don't need the details of method calls in the README, nor do you need installation instructions in the module's man page.
This is a major rewrite using "modern Perl" that supports the following features:
- Generating a README in various formats such as plaintext, POD, markdown, HTML;
- Support for plugins to add new features.
- Support for (via plugins) inserting the module version, recent changes and prerequisites in the README.
It should still work with existing software that uses it, such as Module::Build.
The next steps will be to write modules to integrate this with other release tools, such as Module::Install or Dist::Zilla.
Feedback as always would be appreciated. The module is on GitHub.
Thanks to everyone who commented on previous blog posts about this, and to CPAN Testers for test reports on previous dev releases.
A most amusing annoyance
Came across this in my travels this morning:
$ perl -E 'sub x { say "y"}; my $x = 'x'; $x->();'
y
Undefined subroutine &main::1 called at -e line 1.
Why on earth does this compile and run in the first place? Fixing the shell quotes makes the problem go away.
Which modules are currently loaded by process?
Have you ever wondered which modules are currently loaded by current process? With Perl it's very simple to know this piece of info. Perl saves loaded modules in a hash %INC.
Lets have some dirty hands:
use Data::Dumper; print STDERR Dumper \%INC;
The output is as follows:
$VAR1 = {
'warnings/register.pm' => '/usr/share/perl5/warnings/register.pm',
'bytes.pm' => '/usr/share/perl5/bytes.pm',
'XSLoader.pm' => '/usr/lib64/perl5/XSLoader.pm',
'Carp.pm' => '/usr/share/perl5/Carp.pm',
'Exporter.pm' => '/usr/share/perl5/Exporter.pm',
'warnings.pm' => '/usr/share/perl5/warnings.pm',
'overload.pm' => '/usr/share/perl5/overload.pm',
'Data/Dumper.pm' => '/usr/lib64/perl5/Data/Dumper.pm'
};
The hash simply contains the module path as value.
So this can be used for cleaning up too, with it you can figure out why you're not getting the version of the module you're expecting, for example.
Madison Area Perl Mongers Tonight
Tonight’s topic: REST on your SoC with Device::WebIO
System on a Chip (SoC) devices, such as the Raspberry Pi and pcDuino, are becoming increasingly popular. They almost always have a working Perl installed, and some library for controlling the I/O pins. Wouldn’t it be nice to unify the API across devices? While we’re at it, why not add a REST interface, too? The Device::WebIO modules do exactly that, and this presentation will show you how to use them.
This is also the 20th anniversary of Perl. There is a rumor of cake.
[From my blog.]
Synchronizing Opera bookmarks with Perl, Org, and git
Who here like me still uses Opera (specifically Opera 12 on Linux)? It's being abandoned, the bugs are piling up, and more websites are not rendering correctly on it. However, the combination of keyboard shortcuts and some specific features like editing+applying source code makes me still stick to it.
The Opera makers provide a service called Opera Link that can synchronizes your browser bookmarks and a few other stuffs between computers and mobile devices. However I prefer not to use it and rely on some good ol' tools instead.
I also happen to be a fan of Org so Org will be the master document.
The steps that I describe here might be too much of a hassle, but I like it and thus share it.
First, you install the CPAN module App::ConvertOperaBookmarksToOrg which includes the utilities adr2org and org2adr.
Then you convert your Opera bookmarks to an Org document with this command:
% adr2org -T ~/.opera/bookmarks.adr > repo/opera-bookmarks.org
A Grand, 2014
A couple of days ago I got a tip that I was very close to being the first CPAN author to upload 1000 releases in a year (989). Today I topped it off:

Thus ends my CPAN numbers ambitions. From now on I will concentrate on -Oquality
The -Oquantity and -Ofrequency flags were fun for a while, and it resulted in my getting a large portion of my modules into an up to date state; but numbers for numbers sake has a limited appeal.
Note: It was ironic that one of my final releases was from a pull request by SHARYANTO++ who leads almost all the CPAN statistics. :-)
Getting IP address with Perl
A common situation which you will usually come across, is to retrieve the IP.
Using WWW::curlmyip, this task is very easy.
use WWW::curlmyip;
my $ip = get_ip();
Lets inspect the module on https://metacpan.org/pod/WWW::curlmyip closely to understand how it works.
use strict;use warnings;package WWW::curlmyip;$WWW::curlmyip::VERSION = '0.02';use HTTP::Tiny;use 5.008;# ABSTRACT: Returns your ip address using L<http://curlmyip.com>BEGIN { our @EXPORT = 'get_ip'; our @EXPORT_OK = ();}sub get_ip { die join(' ', 'Error fetching ip: ', ($response->{status} or ''), ($response->{reason} or '')) unless $response->{success}; my $ip = $response->{content}; chomp $ip; $ip;}1;__END__
It's a one file module, which simply contacts http://curlmyip.com, retrieves the content with HTTP GET request, and finally chomps the result; because there exists an extra new line character which is useless.
So simple, isn't it ?
But It's also very useful !
Elasticsearch Custom Scoring
Elasticsearch has a builtin scoring algorithm which works quite well in practice, but sometimes you want to roll your own scoring algorithm. Let's examine how to create a custom scoring algorithm using the function score query.
Let's assume we want to search and score Perl job offers based on a set of weighted keywords. To get the score of each offer, we'll multiply the weights of matching keywords where positive keywords have weights greater than one, and negative keywords are weighted less than one. Thus, the positive and negative keyword matches add and take away from the final product (score) respectively.
Define the Qualitative Importance and Their Weights
Qualitative Tags
Instead of assigning weights directly to keywords, let's use qualitative tags of desirability (importance) for each keyword (trait). Borrowing from okcupid's five degree scale of importance:
- mandatory
- very
- somewhat
- little
- irrelevant
This takes care of the non-negative traits, now let's add qualifiers for negative traits using a similar pattern:
- mandatory_neg
- very_neg
- somewhat_neg
- little_neg
Actual Weights
(Russian) Article about Test::Spec
Article in Russian about Test::Spec benefits and gotchas/internals
Travis-CI Helpers for Perl
I deal with a lot of modules that promise backwards compatibility with older versions of perl, usually back to perl 5.8.1. Since I don't regularly use perl versions that old when developing, accidentally introducing incompatibilities is always a risk. Having a continuous integration system check this for me makes it much easier to catch mistakes like this before they get released into the wild.
Travis CI is a very useful continuous integration service that is free for any public repositories on GitHub. There are issues with using Travis CI for the kind of testing I need though. First, it only provides the last revision of each perl series. Especially in the perl 5.8 and 5.10 series, there are substantial enough differences between them that testing only the latest isn't adequate. Additionally, some of the testing needs to be done on perls built with threading, which isn't included on most of the versions available on Travis. It also is sometimes useful to test without any additional modules pre-installed like Travis does.
Strawberry Perl 5.18.4.1 released
Strawberry Perl 5.18.4.1 is available at http://strawberryperl.com
More details in Release Notes:
http://strawberryperl.com/release-notes/5.18.4.1-32bit.html
http://strawberryperl.com/release-notes/5.18.4.1-64bit.html
I would like to thank our sponsor Enlightened Perl Organisation for resources provided to our project.
Spam on CPAN
Some idiot has just uploaded a purely spam distribution: THEMA-MEDIA. He clearly knows it's idiotic, because his README.md begins with "CPAN-foolishness".
Partitions of an Integer
The subject of integer partitions comes up regularly, with multiple threads over the years at PerlMonks, a big chunk of Chapter 5 of Higher-Order Perl, and some pages from Knuth TAOCP volume 4A. Last year I added a partitions function to my ntheory Perl module, for counting integer partitions (OEIS A000041). A few months ago I added a partition iterator (forpart) since I liked the one Pari/GP added last year.
| Solution | Impl | Order anti-lex |
Order lexico |
Restrict count |
Restrict size |
Max in 10s | Count in 10s |
|---|---|---|---|---|---|---|---|
| ntheory 0.45 | XS | yes | no | yes | yes | 87 | 223,000 |
| ntheory 0.45 | Perl | yes | no | yes | yes | 72 | 7,300 |
| Integer::Partition 0.05 | Perl | yes | yes | no | no | 67 | - |
|
(unreleased, from Limbic 2004) |
Perl | no | yes | no | no | 62 | 6,000 |
| MJD 2013 | Perl | no | no | no | no | 71 | - |
| blokhead 2007 | Perl | yes | no | no | no | 63 | - |
| kvale 2004 | Perl | yes | no | no | no | 62 | - |
| sfink 2004 | Perl | yes | no | no | no | 58 | - |
| tye 2001 | Perl | no | no | no | no | 58 | - |
|
(golfed, 73 chrs) |
Perl | no (73) yes(90) |
no | no | no | 21 | - |
Pari/GP 2.8.0 (not a Perl module!) |
C/Pari | no | no | yes | yes | 100 | 34,000,000 |
Exporter::Tiny nearing 1.000000
Yes, in my warped mathematics, 0.042 is nearly 1.000000.
Exporter::Tiny is a module I split out of the Type::Tiny distribution. It's an exporter, offering roughly the same capabilities as Sub::Exporter, but with a lighter footprint. I've not massively promoted it, but have been using it in a bunch of my other modules, and other people seem to have picked up on it and started using it too.
The documentation requires a bit of work, but from my perspective the implementation is effectively complete. If you're using it, then I'd appreciate any feedback you have before it's "stable" and thus too late to change.
Ideas for perl.org.in | an Indian connecting platform
Friends,
I have found certain outward challenges in perl and have always found someways to overcome them. Some of the common challenges i found specific in India are:
India being such a large country have a number of software development centers across it like: Noida, Gurgaon, Bangalore, Hyderabad, Pune etc. Though there are excellent developers in perl but they are less in number and find them sparsely located across these development centers , ie. few in each centers which makes connecting with each others rather difficult. Though there are some perl monger and other groups here but still as the developers are geographically sparsed in India, they dont connect well, eg. a developer in Delhi will not want to subscribe to Bangalore group because he may not find any merit at it. Same is with the recruiters .
My idea is to create a all india perl group, and also list profiles of most of the people here. There will be a weekly or monthly mailer from the group with a list of opportunities , I am willing to use the domain perl.org.in for this and use catalyst for the same.
Also we will plan remote sessions / google hangouts.
Any person here want to comment on this, and / or will want to contribute towards the design / anything just comment here or at https://twitter.com/perl_org_in ?
I am looking for Derek Price
I tried to get co-maintainer bit for Text::MediawikiFormat, but his e-mail does not get delivered. do you know Derek? Could you help me get in touch with him to become a co-maintainer?
Launched http://perl.careers/
I know what you're thinking. You're thinking: "What this world has too few of, is recruiters. The world definitely needs more recruiters". And given that shocking lack of people trying to get you a job, I've launched Perl Careers.
My eventual goal is to try and do something like O'Reilly did back in the day - divert a significant portion of profits back in to the community via paying for high-quality Perl content/articles, sponsorship of conferences, and sponsorship in to TPF and similar organisations. This is going to take me a while to achieve; I'm planning to sponsor November's London Perl Workshop, and I'm flying to London for it, and I hope to start paying for high-quality Perl-related content at the beginning of next year. ORA used to pay $200-$400 for articles on Perl.com, and I think that's where I'll be aiming.
However, in the interim, I'm hiring for some great roles. I'm only willing to take on roles for companies I'd want to work at, so please get in contact: pete@perl.careers.
About blogs.perl.org
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.