What to avoid in BEGIN blocks

I came along this crazy code.

But first some short explanation. The perl compiler B::C saves the state of any program at CHECK time, and runs it later. That means every action in BEGIN blocks is frozen and then thawed on a potential another machine in later time. Not all action can be frozen/thawed as we know from the common modules Data::Dumper or Storable

The compiler is better than those. It can restore regular expressions which Storable cannot. It can save the state of some IO object, which Data::Dumper can not. It can save the whole dependency tree of code. Data::Dumper or Storable can only save data, not code along with it.

But some actions are really a bad a idea to be restored at run-time.

1st sample:

my $f;open($f,">&STDOUT");print $f "ok"

This is trivial. The fileno 2 is dup'ed to $f. All at run-time. Nevertheless you will not be able to freeze/thaw $f. The compiler can.

Why does your site not link to perl.org?!

Recently an article was published that claimed Perl usage in websites had dropped below 1%. For a Perl developer this seems ridiculous on the face of it. As it turned out, it was ridiculous, since the error margin was 17.6%. Meaning that for 17.6% of the sites they surveyed they could not even detect that they were using Perl. And they only survey the top 1 million, out of the 175 million active sites Netcraft reported. So the validity of these numbers is highly suspect.

So, all is fine? Catastrophe averted? Heh, not really.

Here's the issue: To a Perl developer this might seem ridiculous. Most of us are aware of how many websites use it under the hood. But to the average person it seems perfectly reasonable. The suffixes ".php" and ".asp" are ubiquitous and lets everyone know what the website is running on. Ruby and Python operations are proud of using their languages and flaunt it. To an average person it might even seem like there are more Ruby and Python websites.

Yet Perl is practically invisible. It drives a lot of sites, businesses and livelihoods worldwide, neither of which make any indication of the tools they're using. Let's take a look at a random sampling:

Site Alexa Rank
imdb.com 37
booking.com 245
cpanel.net 1,710
blogs.suntimes.com 2,171
net-a-porter.com 2,195
lovefilm.com 3,149
liquidweb.com 7,776
slando.com 25,266
socialtext.net 145,896
bestpractical.com 161,366
metacpan.org 172,291
hiveminder.com 295,127

These are sites that run on Perl, but to look at them you'd never even know it. Perl has advanced route dispatching mechanisms and its great modularity makes it possible to write an entire website as a single application. In fact, for most modern Perl web frameworks it has become customary to run web applications as self-hosting services to which a web server connects via a network port. Perl has made it very easy to design one's url structure exclusively around the data one serves, which has made it entirely impossible to tell for most Perl-driven sites that they actually are Perl.

Now, all of these sites have reasons to be proud of the tools they use. Some of them indeed are very proud, booking.com for example has donated 150.000 USD last year to Perl development and others on the list have donated smaller amounts as well or are supporting Perl conferences and spend a lot of money to have a presence on Perl conferences. Those on the list who are hiring, are also hiring Perl developers, some of them quite prominently. Even others on the list are websites created for the express purpose of serving the Perl community.

Yet none of them even mention Perl on their frontpage or even link to perl.org. I know Perl doesn't have nice and easy promotion buttons like Python or PHP do. But a simple text link does the job just as well. Just a simple "Built with Perl" in the footer or a sidebar would show that you care about Perl, would make it easier for job seekers to notice that you're looking for Perl devs and would raise the visibility of Perl and make it a more appealing choice for students looking to learn a dynamic language.

I do not believe this is done out of any maliciousness and that it's rather just a simple oversight, something that was never considered. As such i've sent a small email to each of those sites, asking them to consider this issue and to please add a link to perl.org or to weigh in on why they would not do it. Maybe they are issues that the Perl community can fix.

Similarly, if you own a site yourself that runs on Perl and does not link to perl.org:

Why does your site not link to perl.org?!

Perl, Mobile App. glue.

Robin Darby will be giving a talk at YAPC::NA 2012 described as:

Basics of developing web based services for communication with iPhone and Android apps (including sending ‘alerts’, managing updates).

[From the YAPC::NA Blog.]

SOPA and the Internet Generation

I don't want this blog to be political, so all I will post here is this: I have posted some views on SOPA on my non-Perl blog. If you would like to read them, click here. To paraphrase Wikipedia, although this blog is neutral, its existence is not. Thank you.

Indonesian names for software projects/products

Lately I've been choosing Indonesian names for my software projects/codenames, beginning with Sah, and then Rinci/Perinci, Riap, Serabi. Others will certainly follow. These names are words straight from the dictionary, but I plan to extend to proper nouns like island names (we have 17k+ of those!), characters from traditional stories, words from dialects (why, we have hundreds of living dialects too!), famous people, and so on.

The first reason for this is running out of good, distinct English names. Since we have already come to the point of picking household names like "cucumber" and "tasty pie", why not use these household names from a different language altogether.

The second reason is to catch up. Why should non-Indonesians have all the fun picking Indonesian names? :-) This blog post will also lists software projects/products with Indonesian names. I will separate the list as two, those started by Indonesians and those which are not. I will add to the list when I spot new ones.

Projects not started by Indonesians

Submit a Talk for YAPC::NA 2012!

Submit a talk for YAPC::NA 2012. We’re especially interested in talks on real-world Perl apps and quintessential Perl 101 talks, but we’re open to any ideas you have. 

[From the YAPC::NA Blog.]

Keep Those Ideas Coming

A while ago we put up the YAPC idea collector. You’ve given us a lot of great feedback so far, but keep those ideas for YAPC::NA 2012 coming, and keep voting on the existing ideas. 

[From the YAPC::NA Blog.]

GCL Plans

DISCLAIMER: this text is lengthy - if yor not interested in GUI programming or API design, you should stop reading now.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.