November 2011 Archives

Sorting with DBD::SQLite and Mac OS X

At least in my Mac OS X (Leopard) the perllocale and the perl collations that DBD::SQLite make available do not work to properly sort UTF. Or that, or I am doing something wrong. Nevertheless, I found a simple way to do that, thanks to the Unicode::Collate module. Just add a few lines of code after you open your database connection:

my $collator = Unicode::Collate->new();
$DBD::SQLite::COLLATION{mine} = sub { $collator->cmp(@_) };

and then use the mine collation:

$sth = $dbh->prepare("SELECT * FROM somewhere ORDER BY key COLLAT…

The Perl Foundation Grants

As you might know, TPF awards grants to some people, for some tasks. There are some huge grants, like Nicholas Clark's grant or Dave Mitchell's grant on Perl 5. Unfortunately not all of us have the time and/or the knowledge to help in such low level tasks. Nevertheless, TPF has a grant committee that awards small grants (ranging from $500 to $2000) for smaller tasks. Some examples include documentation writing or tests writing for some relevant module, the implementation of some service in the web, the development of a specific module, etc.

Note that if you have a project in mind and …

About Alberto Simões

user-pic I blog about Perl. D'uh!