I am currently working on a ldapsearch program that is suppose to take
fields in ldap and replace them with other data if the info in the ldap
database match, however I have one line that has more then one piece of
data and is seperated by spaces:

mailaltneraddress = [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]

Basically what I want to do is replace:

[EMAIL PROTECTED] and [EMAIL PROTECTED] with something like 

[EMAIL PROTECTED] [EMAIL PROTECTED]

The problem is this line never contains the same number of input:

IE 

One user could have:

mailaltneraddress = [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]

While another could have:

mailaltneraddress = [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]

Does anyone have any suggestions on how to accomplish this. I've tried
something like this:

$result_count = @mailalt;

for ($i=0; $i <= $result_count; $i++) {
 if (($mailalt[$i] =~ m/$emailname\@domain1.com/) or ($mailalt[$i] =~
m/$emailname\@domain2.com/)) {
   $mailalt[$i] = pop(@mailalt);
 }
}

Am I on the right track or is there a better way of trying to do this?

Any help anyone can offer is appreciated. If you need more info let me
know.

Thanks,
D


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to