You only increment $id once. Before incrementing it, you set it to 1. If you want to add an entry to a file, you have first to read the last entry from the file, get its id, increment it, and then write the new entry.
use feature 'say';
my $output = "data.txt";
open(DAT, '+<', $output) || die("Cannot Open File");
my $id;
while (<DAT>) {
($id) = m/\A(\d+):/;
}
say DAT join ':', ++$id, $name, $number, $address, $phone, $email;
close(DAT);
use feature 'say';
my $output = "data.txt";
open(DAT, '+<', $output) || die("Cannot Open File");
my $line;
$line = <DAT> until eof DAT;
my ($id) = $line =~ m/\A(\d+):/;
say DAT join ':', ++$id, $name, $number, $address, $phone, $email;
close(DAT);
Thanks for the quick response and multiple answers...each worked and now I know that I have to read the line before instead of just adding. This makes things easier as before I was using a pattern match in order to edit my entries in the database and now all I have to do is enter a line ID number and I am good to go. Thanks again!