open FILE, "emails.txt" or die "Error Opening: Cannot open file!"; @emails = ; close FILE; $email = $emails[int(rand($#emails + 1))];