$hash{$1} = substr($data, pos($data)+1, $2) while ($data =~ /(\w+)\[(\d+)\]/g);