# ... my %database; my @employee_details; my @mykeys; open(FH,"+>>database.txt")|| die 'Cannot open the file'; print FH %database; close FH;