- # Loop through the array of nameservers.
- foreach my $server (@nameservers) {
- # Add the DNS server to the line.
- $line = "$line" . "$server";
-
- # Check if the current DNS server was the last in the array.
- if ($server ne $nameservers[-1]) {
- # Add "," for the next DNS server.
- $line = "$line" . "\,";
- }
- }