Entries Tagged ‘Technology’:

Perl’s Join Function


Reading other people’s code can be quite revealing at times. Having recently started a new job, I get the daunting (… or delightful?) task of diving into unfamiliar, pre-existing code. A new experience for me, and one that has helped me grow much in the last couple months.
 
The Perl join( ) function is a perfect example.
 
In the past, I would manually loop through all the elements, concatenating the delimiter inside the loop.
 

Then I would chop( ) the last delimiter off the end, like so …

my @rray = qw(Joe Nancy Brett);
my $tring = “”;
 
foreach my $name (@rray) {
$tring .= $name.”,”;
}
 
chop($tring);

… when all along, the same job could have been executed with two lines.

my @rray = qw(Joe Nancy Brett);
my $tring = join(‘,’,@rray);

A little more time invested in manual reading might be well-spent. :~/

Tags: , ,

Leave a Comment

Firefox 3.6 Released

For the sake of honesty, you should know that I’m a geek. I often get excited about new software and hardware releases. Firefox of course, is one of the best things to ever happen to Internet users. If you haven’t used it yet, I just don’t know what to say. You would have to be either really behind the times, or technologically inept. That said, there are also several other browsers that are great and have my recommendation as well (i.e. Opera and Chrome). It never hurts to have multiple browsers installed (I always do).

Now, the newest release of Firefox is purportedly 20% faster than the previous version 3.5, which was already pretty fast, especially when compared to Internet Explorer. From watching the new features video, Firefox has also now integrated one of its most popular add-ons, Personas, which is a visual theme editor that has thousands of options for changing the look of Firefox. Customization and great add-ons, like Firebug and Fire Gestures, are some of the reasons I’ve used Firefox so long, and why I will probably continue for a long time to come.

Tags: , , , ,

Leave a Comment