Are you using the same if/else statement in multiple places? Is your statement long and hard to deal with?
if ( $is_true ) {
if ( $conditional eq 'one' ) {
# do stuff
} elsif ( $conditional eq 'two' ) {
# do something else
} elsif ( $conditional eq 'three' ) {
# do stuff
# do something else
}
} else {
if ( $conditional2 eq 'four' ) {
# do stuff
} elsif ( $conditional2 eq 'five' ) {
# do something else
} elsif ( $conditional2 eq 'six' ) {
# do stuff
# do something else
# do stuff
# do something else
}
}
You can see the repetition in the comparison of the conditional and the things that are done in the blocks. We can abstract it out.
if ( $is_true ) {
{
one => 'functionone',
two => 'functiontwo',
three => 'functionthree',
}->{ $conditional }->();
} else {
{
four => 'functionone',
five => 'functiontwo',
six => 'functionsix',
}->{ $conditional2 }->();
}
sub functionone {
# do stuff
}
sub functiontwo {
# do something else
}
sub functionthree {
functionone();
functiontwo();
}
sub functionsix {
functionthree();
functionthree();
}
Now our if/else block is looking a lot better. We’ve placed all our code into reusable functions, so when we have to edit, its only in one place. This makes the code a lot more maintainable. But, we can still make it better. Why not combine the hashes into one?
choose( ( $is_true ? $conditional : $conditional2 ) );
sub choose {
{
one => 'functionone',
two => 'functiontwo',
three => 'functionthree',
four => 'functionone',
five => 'functiontwo',
six => 'functionsix',
}->{ $_[0] }->();
}
sub functionone {
# do stuff
}
sub functiontwo {
# do something else
}
sub functionthree {
functionone();
functiontwo();
}
sub functionsix {
functionthree();
functionthree();
}
And there you have it. Now obviously, this is an overly simplified example, but you can see how the abstraction makes the code more readable and ultimately much more maintainable. It’s a great methodology for anything with a lot of repetition.
I got a hamster. He is a long haired syrian. Very cute.


My Asus Eee PC 1000 HE ( ‘eee’ ) arrived with 1GB ram and Windows XP. Neither of those were going to cut it. So I got to work right away at modification. First I replaced the ram with an OCZ 2GB ram. After that it had the following specs:
- 160GB HDD
- 2GB ram
- 1.66GHz Intel Atom
- 10.1″ screen
Next I got to work on the OS. I put Ubuntu Netbook Remix on my flash drive and booted up. Right off the bat I was unimpressed with the features that were supposed to be netbook specific. Then when I tried to connect to my wireless network, nothing. It could see it, but it couldn’t connect. I tried changing the wireless from WPA to WEP and then completely unsecured. Still nothing. Hours passed trying to get it working. Finally I decided to try a different distribution. I tried Easy Peasy and Cruncheee with no luck. Then I gave up on the netbook specific distros and got Ubuntu’s latest release, Jaunty Jackalope. I connected right away. And that was fine with me. None of the netbook distros really impressed me that much.
So I backed up the windows installation, just in case. I can’t imagine using it but I’d rather have it to fall back on. Then I installed Ubuntu and got some programs installed, including Cheese and twhirl. Finally I set up my dsa key so I can login and do work.
Now that I’ve had eee for a few days, I am really happy with it. It is light and extremely portable. The keyboard is comfortable and set up well. The multitouch features of the touchpad are nice, although the buttons are a bit stiff. I have been using that and my retractable usb travel mouse with it, which took some getting used to, but is ultimately very nice. It boots up faster than my work laptop, which has a 1.86 GHz proc but runs Windows. I haven’t played with the webcam yet, except to know that it works. The screen is nice and doesn’t have glare, so it can be used outside or in front of a window. The one drawback is the ease with which fingerprints dirty the glossy surface. At least it came with a shammy to wipe it down.
This model was recommended by Maximum PC and cnet uk. And I echo their recommendation. It’s a great little netbook.



Once I got digital cable, the living room computer ( ‘nas’ ) was no longer needed as a dvr. While it still served as a firewall, backup storage, and instant internet machine, it really wanted to get back in the game and do something fun. With our annual Memorial Day vacation coming up, Funspot was on our minds. Not wanting to wait to play the classic arcade games, it was decided that the nas would become an arcade machine.
With a fresh install of ubuntu, it was time to put it to the test. Xmame was installed, games were downloaded, and playing ensued. It was a great success. But the arcade games weren’t enough. It was time to go back to our childhood consoles and play our favorite games all over again. GFCEU and GENS were added to the machine. A game pad was hooked up.
I have to say, playing 8-bit video games on a 46″ TV is simply awesome. Despite the incredibly outdated graphics, I love the old side scrolling games more than a lot of the console games that are out today. I’ve been obsessively playing Mario 3 and Punch Out!.
What I need now are the classic games from my intellevision, commodore 64, and 486. Snafu here I come!
I’ve been watching the Phillies for as long as I can remember. They were the reason I started playing t-ball so many years ago. And for me at least, watching the Phils wasn’t just about seeing the action. It was about hearing the play by play. And every Phillies fan knows that voice: Harry Kalas.
When I was a kid his voice meant baseball to me. It wasn’t until I left Philly that I realized how much of an icon he really was. Watching the Phils on ESPN or local channels left me wanting more. No sportscaster could take his place. No one could call the game quite like he could.
In 1993 I was away at girl scout camp when the Phils were playing in the World Series, and we all had our radios tuned to hear Harry call the game. He had so much energy and emotion in his voice it was like we were there. They ultimately lost, but its something I will never forget.
And listening to him call the 2008 World Series last year was a great experience. He didn’t just call the game, he captured the whole feeling of the stadium in his words. No one could do it better.
In memory of Harry Kalas: March 26, 1936 - April 13, 2009
F.E.A.R. 2: Project Origin is the long awaited sequel to F.E.A.R.. It is a horror themed FPS that picks up where the previous game left off.
The game itself was not very hard. Playing on the hardest setting I only found a few spots that were truly difficult to get through and required multiple tries, although the checkpoint save system did add a bit to the intensity. The AI was done well, but became predictable after some time. It was extremely linear, as there was a set path you were forced to follow, although there were many rooms and other areas to explore.
The graphics were well done and I was able to run it on my machine with all the highest settings without having any problems.
The story was well written and kept me engaged and wanting more. They did a good job keeping the ’spookiness’ aspect in the game. And although there could have been more sections like that, the parts that were there were very well done and succeeded in scaring me several times.
I did not like the fact that it was done through Steam. There were times that I wanted to play the game but Steam was down. Add to that the fact that people were frequently chatting me while I was trying to play, and you get some frustration.
The awards were (and still are) a source of great fun for me. They just went on in the background while I played through the first time, and I enjoyed seeing how many I got at the end of the game. Now I am playing the game through again on easy with two goals: getting all the awards and finishing the game without dying (so far so good).
Overall I really enjoyed this game. It may not have been difficult, but it was a lot of fun. 8/10
My current gaming rig, fondly known as ‘wheels’:

