First off, thanks all.
Aristotle... I appreciate your comments but I'm not really a perl programmer and I don't particularly want to be. ;-) When I write server side scripts from scratch I use PHP and I tend to enjoy it. :-)
The code I gave is modified from the file access routines that an existing set of scripts was already using. I'm aware it's redundant, server intensive, and generally low end. What you saw was only the beginning. The entire member database is flat file.
The client, however, didn't ask for a rewrite (just a new script to do X, X and X) and they definitely didn't pay for one.