”Under samma villkor som perl”

Ja det är fan inte lätt.

Most modules on CPAN carry a licensing blurb saying something like ”you can distribute this software under the same terms as Perl itself”. This obviously begs the question what does it mean. Here is what it means for different Perl versions:

Shlomi Fish @ UsePerl

You’ve Come a Long Way, Baby

Andy uppmärksammar att allas vårt favoritspråk Perl fyller tjugo år idag. Någon galning har ”portat” perl1 så att den går att bygga i moderna miljöer. Roligt! Wishlisten från orginalpaketet får i alla fall mig att dra på smilbanden.

Vilka har hängt med hela svängen? Själv tror jag att jag hade min första kontakt 1996 när jag började använda lib-cgi.pl. I retrospekt ett väldigt dåligt val. Jag borde ha tagit mig an CGI-modulen och objektorientering direkt. Antagligen hämmades min perlutveckling väldigt mycket genom att använda redan då föråldrade tekniker. Det är först på senare år som jag lärt mig att på riktigt utnyttja kraften i språket.

Hur som helst: tack Larry. Och grattis på tjugoårsdagen perl!

Using Text::IConv or Unicode::String? Converting UTF8 to ISO-Latin1 in Perl.

For quite a while I’ve been stuck in a project in which I read some some data from a set of XML-files generated from an external program. The data loading smoothly done by XML::Simple, but the fact that the target is a mysql database with ISO-8859-1 (ISO-Latin1) while the XML is encoded in UTF-8 has caused a few problems.

Perl doesn’t AFAIK come with any really good convertion routines with the standard modules, and since I was somewhat familiar with the GNU-projects libiconv it come naturally too look after a perl module that uses it. After a quick search, Text::Iconv was found on CPAN

However I quickly ran into a few problems: Text::Iconv is only as portable as it libiconv – and just having a binary dependency is a hassle when moving between alot of platforms. Text::Iconv also had some of libiconvs strange behaviour and very limited error handling. Sometimes the converted text was streal strange and I has not been very statisfied.

Today I stumbled upon Unicode::String that smoothly convert between utf-8 and differenet charsets. The potential of supported charsets is less than libiconvs – but since it got ISO-Latin1 I am all happy. After a test round I replaced all convertion calls and so far I have not noticed any real performance drain and no problems at all – as of yet.

CPAN <3

Tio senaste: