Leedberg.com

The online home for Greg Leedberg, since 1995.

Wednesday, October 05, 2005

My name is Greg, and I like Perl.

I really want to update this blog more often, but I never can think of what to write! Thing is, in real life I always seem to have something to talk about. I think I'm going to start just trying to write something in here more often, just odds and ends about what's on my mind. It need not be newspaper-worthy. :)

I found a really cool Perl library the other day. X11::GUITEST. I never knew anything like it existed. It's a library that lets you programmatically control GUI windows. You can write Perl scripts that wait for certain windows to open, click on buttons, maximize windows, minimize windows, enter text... pretty much anything you could do with a mouse and keyboard. Really, really neat. It only works with Perl and X11-based display systems, though... so pretty much any flavor of Unix, but not Windows. I did find something similar for Windows, AutoIt, but I haven't played around with that very much. Supposedly it does the same thing, but with a Visual Basic-like language. I'd prefer a Perl derivative.

Which reminds me, I love Perl. Perl is, I think, the best and most useful language out there. Sure, it's not great for writing big GUI applications or enterprise systems, but it's really great for performing more internal tasks that would take a ton of code to accomplish in other languages. Especially for things like text processing. It's great for being the "glue" between other programs or just addressing a particular problem you can't figure out how to solve with a traditional language. I first used it at UNH on a project with a professor, and fell in love with it. There's so many times when you can do something in, like, 5 lines of Perl that would take tens or hundreds of lines in, say, Java or C. I'm using it a little now at work as well... not necessarily because of a high-level directive, but because I find instances where it would be useful, so I just use it.

A really good book on Perl is Programming Perl, by Larry Wall. Larry Wall is actually the creator of Perl. This book isn't just a great reference on Perl, it's also I think the best technical book I've ever read. It's actually a joy to read even if you're not trying to learn anything specific about Perl. Larry Wall is a linguist first and a computer scientist second, and it shows in his writing. And it also shows in how the Perl language is defined... very free-form. Lots of ways to do things. You can be very structured, or you can write a whole program in one very cryptic line of regular expressions.

I promise not every post will focus on programming. :-)