Thank you all very much for the quick responses, all of them really helpful and instructive. So far I have tried JavaFan's and Nkuvu's solutions, and they work just fine. (I will need some time to understand exactly how they work though, might come back here if I fail to do so...). Thanks also for the pointers to Data::Dumper and the explanation as to why I was getting that error.