If you are still intrested in the topic in general (using perl to manipulate data sets) Check out this book Data Munging with PERL It give a real good background on dealing with different types of data and has helped me alot in figuring things like this out.