Thanks! I've been using a more baroque version of the code I free-typed in here for a while now, and I've been checking with Data::Dumper already, but somehow I'm having difficulty with its coding style sometimes :)
This clarifies things - it's the way I thought, but sometimes it's nice to have confirmation.