June 2012 Archives

Data::Dump::Color (proof of concept)

rjbs' blog post mentioning Data::Printer prompted me to try it out just now. Coincidentally, earlier today I was investing terminal's 256-color support, Emacs color themes, mc skins, all those color-related stuffs.

After seeing Data::Printer output, I think I want colors in my dumps, but I don't want some new syntax/format; I just want to see Perl. So I quickly hacked Data::Dump::Color. ="http://metacpan.o…

How many of your dists are in Debian?

Here's a small script which I whipped up just now. I thought of trying out MetaCPAN::API, but after about 5 minutes of trying to find a way to list an author's distributions (and failed), I resorted to a quick hack using Mojo::DOM.

Here's a sample output:

$ list-cpan-dists-that-have-debian-packages adamk
Algorithm-Dependency
Archive-Zip
Asp…

Perl sighting #2: aboutus.org

$ whois bonchon.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

...
=-=-=-=
Visit AboutUs.org for more information about bonchon.com
AboutUs: bonchon.com


Domain name: bonchon.com

Registrant Contact:
BonChon
Jinduk Seh ()

Fax:
213 W 35th Street

The nice thing about short-circuiting

I just noticed in my own code that even though I am comfortable with this expression:

$a //= 123;

when the right-hand side is some function call, especially one with side-effects or big performance penalty, I tend to write:

unless (defined $a) { $a = foo() }

which is silly because // and //= short-circuits. The same case for || and ||=, et al. It's just irrational fear.

About Steven Haryanto

user-pic A programmer (mostly Perl 5 nowadays). My CPAN ID: SHARYANTO. I'm sedusedan on perlmonks. My twitter is stevenharyanto (but I don't tweet much). Follow me on github: sharyanto.