use strict; use warnings; our %people = (); # I use 'our' for global and 'my' for temporary data our $ksep = "\r"; # you define your key separator our $dsep = "\t"; # you define your data separator # I use chr(30) & chr(254) respectfully! # Use something that will not be part # of the raw data or use 'pack' for the # length of the data elements. my $key = 'pat'; my $data = "$key$ksep"; $data .= "Name=$key$dsep"; # You can use "\t" instead of '=' $data .= "Address=50 car road$dsep"; $data .= "Postcode=aa1 1ab$dsep"; . . . $data .= "END=Finish"; # I like an end ( helps with 'split' ) $people{$key} = $data # key is also part of data # This can now to saved in a flat file or database or both. # You need a double 'split' to get the key and data # Then each data field needs to be split on '=' or "\t"