M
marcorice
I am new to perl and have had this problem for a while now.
I'm doing an ldapsearch with the following result of a record set.
CN=junk
mail=emailaddess
employeeID=somenumber
givenName=first_name
middleName=middle_name
sAMAccountName=somnumber_or_string
sn=last_name
telephoneNumber=telephone_number
userPrincipalName=some_email_string
extensionAttribute13=somenumber
Sometimes I get more than one set of records separated by blank lines.
I need to do somekind of loop that evaluates each set separately.
chomp(@info= (`ldapsearch -p $PORT -b DC=com -s sub -h $SHOST
"(&(sn=$lname)(givenName=$fname))" givenName middleName sAMAccountName
sn
employeeID mail telephoneNumber extensionAttribute13
userPrincipalName`));
foreach $list (@info) {
if ($list =~ s/extensionAttribute13=//){
$ntuid = $list;
}
elsif ($list =~ s/telephoneNumber=//){
$telenum = $list;
.........
I'm doing an ldapsearch with the following result of a record set.
CN=junk
mail=emailaddess
employeeID=somenumber
givenName=first_name
middleName=middle_name
sAMAccountName=somnumber_or_string
sn=last_name
telephoneNumber=telephone_number
userPrincipalName=some_email_string
extensionAttribute13=somenumber
Sometimes I get more than one set of records separated by blank lines.
I need to do somekind of loop that evaluates each set separately.
chomp(@info= (`ldapsearch -p $PORT -b DC=com -s sub -h $SHOST
"(&(sn=$lname)(givenName=$fname))" givenName middleName sAMAccountName
sn
employeeID mail telephoneNumber extensionAttribute13
userPrincipalName`));
foreach $list (@info) {
if ($list =~ s/extensionAttribute13=//){
$ntuid = $list;
}
elsif ($list =~ s/telephoneNumber=//){
$telenum = $list;
.........