Nice to see that the developers of Perl are still solving the important problems:
say() is a new built-in, only available when use feature 'say' is in effect, that is similar to print(), but that implicitly appends a newline to the printed string.
A new prototype character has been added. _ is equivalent to $ but defaults to $_ if the corresponding argument isn’t supplied.
—perldelta for 5.10
This is exactly the kind of stuff that made me give up on Perl.
Last night I wrote my first program in Ruby. So far I like it, a lot.
I’d been intending to learn something better than Perl for a long time. Perl is very useful, and with CPAN you can get a great deal done in very little time. (Thanks, Jarkko—how’s it going?) However, it’s a really crufty and syntaxy language, and the way it supports object-oriented programming is so butt-ugly and riddled with pitfalls that I had never bothered to get to grips with it enough to write my own classes.
I wrote some Perl, and cleaned out all the links to LiveJournal threads from my journal. If you posted comments in response to anything in my journal, sorry, they’re gone, you know why. I also replaced all the LJ usernames and journal and community links; damned if I’m going to give them any free (good) publicity.
People have asked, but no, I’m not going to waste any more effort trying to get the LJ management to clean up their act.
Apparently there are some people still falling for that “freeipod.com” pyramid scheme. I posted a pretty skeptical analysis last month, but TrollJournal ate it. I thought the whole pyramid would have collapsed by now, but it seems not. So, let’s repeat the analysis…
Let’s try to give freeipod.com the benefit of the doubt, and be optimistic in our analysis.
First off, note that every time someone goes to the site and registers directly, rather than being referred there, nobody gets credit for that new member, so existing members are less likely to get their free iPods.
For a while now I’ve been plagued by mysterious e-mail sync problems. I’d read something and delete it on one machine, and then I’d log in on another machine and it would be back. This wouldn’t be unexpected, except that I use IMAP for my mail, which is supposed to fix such problems. I eventually deduced that the real problem, which IMAP had been unable to solve, was that mail was being held on the server in mbox format.
Problem: Write a program which takes a string on standard input, and reports the most frequently occurring characters in the string.
Solution:
#!/usr/bin/perl -w @c=split /[n.]*/,;foreach$c(@c){$n{$c}=$n{$c}?$n{$c}+1:1;} foreach$x(sort{$n{$b}$n{$a}}keys%n){print"$n{$x} x $xn"}; I just couldn’t stop myself…
Shoddy workmanship. RPM was discovered to be broken in 2002; it would regularly corrupt its own databases and lock up in such a way that it couldn’t be killed. In spite of that, RedHat went and made two major releases with a broken RPM.
Bad packaging. The RedHat 8 release of libgcj (the libraries for the GNU Java compiler) puts a broken version of jar into /usr/bin, destroying any working version you have installed.
…though you’d never guess from looking at my desk.
After cleaning the house at the weekend, I bought some financial management software. I now have a set of accounts for all my various assets, UK and US. Mmm, double-entry bookkeeping. Brings back some memories… Previously I used a spreadsheet and some Palm software. It kinda did the trick for answering questions at tax time, but reconciling accounts was a pain.
Someone at work wanted a Microsoft tool for producing large files of particular sizes, to fill up a disk and stress-test applications under low disk space conditions.
So I wrote one in Perl in a few minutes, to get my brain started for the week. For kicks, I gave it built-in help, and made it understand sizes specified in both base 10 and base 2 sizes—e.g. stresstest 10MiB 55MB 1GiB to create three files of the appropriate sizes.
Got home, booked tickets to Minnesota. It’s funny, when I married Sara I didn’t really think about the fact that it would mean visiting Minnesota every other winter. Not that I’d have decided differently; I’m just amused that it didn’t occur to me.
Also fixed my web site. The Perl script rewrote most the HTML for AT&T’s web servers, but I had to change a few URLs in my LiveJournal template and fix the redirection at pobox.