Sorry,
The perl script got distorted while posting, here is snapshot of the exact line:
foreach $entry ($mesg->all_entries) # for each entry
{
@dn = map {s/[a-z]+=//gi; $_ = ucfirst} reverse split /,/, $entry->dn; # organization
shift @dn;
pop @dn;
print '"'.(join '","', "@dn", map {
get $entry, $_->[1], $_->[2]} @fields)."\"\n"; # row
}
Please be cautious that "get" is actually a subroutine as mention is script:
sub get # get field value
{
return $_[0]->exists($_[1])
? $_[0]->get($_[1])->[$_[2] ? $_[2] : 0]
: '';
}
If still it is not clear, here is the link to access the script, from where I have downloaded the script:
ZDO.COM - Articles - Export Data From LDAP As CSV
Thanks,
Raj