#!/usr/bin/perl use Net::LDAP::LDIF; use Net::LDAP::Entry; use Data::Dumper; use strict; use warnings; my $ldif = Net::LDAP::LDIF->new( "../packages/ldapsearch2.ldif", "r") or die "file not exits\n"; while( not $ldif->eof ( ) ) { my $entry = $ldif->read_entry ( ); #this doesn't work print "HERE is the DN!!!"."\n"; # 'asn' => { # 'objectName' print "anything?" . "\n". $ldif->{'asn'}{'objectName'}. "\n"; # but this shows the dn's in the output, but how do I get them to print? print Dumper $entry; } #the following doesn't work.. my @arrayOfDNs = keys %$ldif; print "here are all the dn's:"."\n"; print @arrayOfDNs;