Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

stu42j (6348)

  (email not shown publicly)

Journal of stu42j (6348)

Thursday August 20, 2009
10:42 PM

From user to contributor

Almost a year ago, I found a bug (er, inconsistency?) in while working on a project with scrolling lists and optgroups. There was a simple workaround but I submitted a bug report anyway and then sort of forgot about it.

A few weeks ago, MARKSTOS updated the ticket asking for an automated test. This happened to come in on a weekend when I had a little free time so I went ahead and submitted a couple of patches, adding some tests as well as a simple code fix. Well, last week my patches were accepted and I now officially have code in!

This experience has given me a little bump of encouragement to finally start contributing more. Today I got my PAUSE ID. I mostly plan on contributing to existing modules but I wanted to have my ID ready in case I ever write something worth sharing or find a module that needs adopting.

Earlier this week, I was reading through the CHI docs, a module I hope to use soon, and I noticed a couple of minor errors in the POD. I also noticed that the module was on GitHub so I figured why not fork it and fix it!

Thursday August 14, 2008
12:07 PM

What not to do in a job interview

All this talk about job application/interview tips has reminded me of my favorite personal interview horror story.

I was invited to a telephone interview for a job with Yahoo in California. I wasn't really interested in moving to CA but I figured what the heck. How could I say no to Yahoo, right?

The programming part of the job turned out to be mostly in PHP which I didn't realize at first. I don't really have a good opinion of PHP but my experience with it has been limited and based on free internet code, not enterprise systems.

So, when prompted if I had any questions, I tried to say that I was curious about how Yahoo has used PHP in a positive, efficient way and what aspects of the language they feel makes it best suited for their environment. I guess what I actually said sounded to the interviewer more like "PHP sux and you are stupid for using it."

Unfortunately, I didn't get much of a response and needless to say, I didn't get the job (or even a free trip to CA).

Tuesday May 13, 2008
09:07 PM

Curse of the Double Equals

Every beginner programmer (of C-style languages) has to learn to deal with '=' (assignment) vs. '==' (comparison). Using = in an if clause is probably one of the most common early mistakes.

I'd like to think that I'm past that stage of my programming experience. However, about once a year I'll waste a couple of hours debugging to eventually notice the missing =.

I was working on some Javascript today and I had the feeling something was wrong with that if but my brain kept telling me to change the = to eq. Must be the jet lag from Ireland. Yeah, the jet lag. That's it, that's the ticket.

Wednesday January 30, 2008
11:39 AM

use.perl problems

Is it just me or has been real flaky lately? Seems like the connection times out about half the time.

Monday August 27, 2007
06:31 PM

Must have (recent) Perl books?

Tuesday night dfw-pm is having a technical meeting hosted at NerdBooks in Richardson. I am planning to take advantage of the opportunity to pick up a copy of Perl Testing. I have also been trying to decide if I need a copy of PBP. I currently have the misfortune of working on a SOAP project which I am having trouble wrapping my brain around so perhaps I should go ahead and get Programming Web Services with Perl (does it have much that is not free online?).

Any other recommendations for must-have Perl books, particularly those recently published? I already have Perl Hacks. Shameless plugs and non-Perl books also allowed.

01:49 PM


There Is More Than One Way To Do It - Not All Of Them Are Good.

Some legacy code that I am working on, frequently uses this "interesting" idiom for getting the first element of an array.

my @array = some_function();
my $i = 0;
foreach my $hash (@array) {
  $var = $hash->{somekey};

I am particularly puzzled by the unused $i.

Wednesday August 15, 2007
01:17 PM

One disadvantage of using Perl...

Friday June 08, 2007
03:32 PM

Perldoc Search Suggestions

In my daily programming, I frequently search the perldocs from the Firefox search box (even though a Perl Pocket Reference sits on my desk). When you start typing a search query for Google you get suggestions on what you might be typing. This is often useful and occasionally amusing.

Wouldn't it be nice if you could get suggestions when searching perldoc too? It turns out to be pretty easy to setup. To get started, I took the functions list and pushed it into an SQLite db. Then wrote a short script to output the required JSON.

You can install the end result from Mycroft. I'm not sure it is particularly helpful but it was an interesting little diversion.

Thursday May 31, 2007
10:25 PM

Delayed String Interpolation (aka, always check the FAQ)

I was trying to fix some code today that was attempting to do delayed string interpolation. Something like:

$str = 'Foo: $foo';  # Actually defined in a config file.
$foo = 'bar';  # ...later
print eval("\$str"), "\n";

Except that just gives you:

Foo: $foo

My first thought was to check the FAQ but then, no, I think I've seen something like this in the eval doc. No, that's not helpful. Oops, gotta catch the bus...

Then I figure I'd take a shot at it before bed. I give Google a try but the closest hits are on Ruby. After an a-ha moment I came up with this:

print eval(qq{"$str"}), "\n";

Which works. But then as I start writing this post, I figure I'd better check the FAQ before I sound like an idiot. Yes, it is in the FAQ although my solution seems much simpler. Am I overlooking any problems with my solution?

Here's what the FAQ suggests:

eval { $text =~ s/(\$\w+)/$1/eeg };
die if $@;

Friday April 13, 2007
10:10 PM

Plagger - Personal Planet

I've been experimenting with Plagger for creating a personal planet sort of thing. It works pretty well. It seems very flexible but it is hard to figure out how to really take advantage of all the options and "plugability". For example, I wanted to change the title of some of the individual feeds. Eventually I figured out that if you use the explicit method of defining a feed, rather than the typical url only shortcut, you can specify the title. Like this:

- url: http://rss.whatever...
  title: This is a title

I'm also finding that even though lots of sites give you feeds, they are not always very good. Netflix gives you feeds of the DVDs you are watching but rather than giving you a pubdate tag, they put the date in the description. Now I'll have to see if I can use Plagger to fix it.