Net::LDAP::Entry::ToText - Conterts a Net::LDAP::Entry object to text.


Net-LDAP-Entry-ToText documentation Contained in the Net-LDAP-Entry-ToText distribution.

Index


Code Index:

NAME

Top

Net::LDAP::Entry::ToText - Conterts a Net::LDAP::Entry object to text.

VERSION

Top

Version 0.0.0

SYNOPSIS

Top

    use Net::LDAP::Entry::ToText;

    my $foo = NetLDAPEntryToText($entry);
    ...

EXPORT

Top

NetLDAPEntryToText

FUNCTIONS

Top

NetLDAPEntryToText

AUTHOR

Top

Zane C. Bowers, <vvelox at vvelox.net>

BUGS

Top

Please report any bugs or feature requests to bug-net-ldap-totext at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-LDAP-Entry-ToText. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Net::LDAP::Entry::ToText




You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-LDAP-Entry-ToText

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Net-LDAP-Entry-ToText

* CPAN Ratings

http://cpanratings.perl.org/d/Net-LDAP-Entry-ToText

* Search CPAN

http://search.cpan.org/dist/Net-LDAP-Entry-ToText

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


Net-LDAP-Entry-ToText documentation Contained in the Net-LDAP-Entry-ToText distribution.
package Net::LDAP::Entry::ToText;

use warnings;
use strict;
use Exporter;

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

our @ISA         = qw(Exporter);
our @EXPORT      = qw(NetLDAPEntryToText);
our @EXPORT_OK   = qw(NetLDAPEntryToText);
our %EXPORT_TAGS = (DEFAULT => [qw(NetLDAPEntryToText)]);


our $VERSION = '0.0.0';


sub NetLDAPEntryToText {
	my $entry=$_[0];

	my $dn=$entry->dn();
	#return undef if it fails
	#if this fails it means 
	if (!$dn) {
		return undef;
	}

	my $text='dn: '.$dn."\n";

	foreach my $attr ( $entry->attributes ) {
		my @values=$entry->get_value($attr);
		my $valuesInt=0;
		while (defined($values[$valuesInt])) {
			$text=$text.$attr.': '.$values[$valuesInt]."\n";
			$valuesInt++;
		}
	}

	return $text;
}


1; # End of Net::LDAP::Entry::ToText