Regexp::Open. It's neat, it's a state machine implemented in C with an XS interface to it. I took a look at it and realised the concept looked a little familiar.
He was just telling me about how he could use it to dynamically change the state machine at runtime when I pointed him at the shishi repository...
This week, I showed them about split and asked them to write something to read the hash back in, and prompt for a name, then display that user's favourite colour. One of the students - a bright girl - said "Why should I use a hash?" and came up with something like this:
use strict;
open IN, "favourites.txt" or die $!;
print "Who do you want to know about? ";
my $input = <STDIN>;
chomp $input;
while (<IN>) {
chomp;
my ($name, $colour) = split/:/;
if ($input eq $name) {
print "$name's favourite colour is $colour\n";
}
}
What can you say? It's decent code, it fulfils the spec, it just wasn't exactly what I had imagined. Ah, the fun of TMTOWTDI...
The reason the US government publically gives for moves against Iraq and Saddam Hussain is that Iraq is trying to develop "weapons of mass destruction" - nuclear weapons. Developing nuclear weapons is obviously a big no-no, which is why Iraq had to have the UN weapons inspectors in.
If this is the real reason (which I really doubt that it is) then why didn't America send the boys in when India or Pakistan went nuclear? And what goes on in the minds of these government folk that they can simultaneous believe that developing nuclear weapons is such a venial sin that we ought to go and assassinate the President, but the fact that the US already has nuclear weapons is good and proper? Obviously it's a flimsy excuse, but why has nobody called them up on it?
"Free to good home - Baby carrying rucksack"
The phrase "snake oil" takes on a whole new meaning.
I have agreed to become a children's church assistant. (Which is obviously the PC version of "Sunday school teacher".) You are free to imagine your favourite BOFH attempting humility, patience and kindness towards a bunch of screaming five-to-thirteen year olds.
LWP rocks. We all know that. But when was the last time you sat down and thought about the fact that someone actually coded it, rather than it being the gift from above it might behave like?
You can tell it's a nightmare if it has clowns in it.
Call me a boring young fart, (but you knew that already, right?) but I'm still amazed how many people can copy a mildly amusing idea and still think they're being original and amusing.
So you can do source transformation. Good for you. Don't people have either better or at least more amusing things to write? I guess not.
It's getting even more tedious than quoting the Four Yorkshiremen.