Welcome to the Monastery | |
PerlMonks |
Re: Reformat command output inlineby haukex (Archbishop) |
on Jun 29, 2016 at 13:13 UTC ( [id://1166882]=note: print w/replies, xml ) | Need Help?? |
Hi RenMcCourtey, While what you want to do could be done with a oneliner*, as the code gets more complex it's certainly advisable to use the proper tools for the job. Apparently ldapsearch outputs in LDIF format, which can be read by, for example, Net::LDAP::LDIF. Here's a quick example I whipped up using the documentation, its output looks like what you want:
If it's an option for you, you could maybe use Net::LDAP for all your work. (Disclaimer: I don't have experience with the module. It does have a long release history and good reviews, though.) * I'd strongly recommend the above instead, this is just an example of one way to do it:
Hope this helps,
In Section
Seekers of Perl Wisdom
|
|