What I need to do is change a string such as "CN=bobvilla, OU=People, DC=example, DC=com" (can have many DC='s in the string) to "example.com"
I have this method but It seems sloppy to me and wanted to see if anyone had a better idea.
my $str = "CN=bobvilla, OU=People, DC=example, DC=com";
print "old: $str\n";
while($str =~ s/DC=([^,]+)//)
{
$new_str .= "$1.";
}
$new_str =~ s/\.$//;
print "new: $new_str\n";
thanks~