From: Behruz R. <beh...@cp...> - 2001-03-30 19:14:25
|
I think if you read carefully the previous article, you will see how to dump you entries into a ldif file. This is the code from the article. my $ldif = new Net::LDAP::LDIF ('example.ldif','w') || die ("failed to open example.ldif. $!\n"); $ldif->write($entry); $ldif->done(); Behruz -----Original Message----- From: Eric Nichols [mailto:eni...@cp...] Sent: Friday, March 30, 2001 11:05 AM To: Behruz Rushenas Subject: Re: Writing an LDIF to a variable? Close but no cigar. Although I did fine a nice dump function which dumps an Entry object to STDOUT. I just need something simple like: $myvar=$ldif->dump($entry) or something like that. ----- Original Message ----- From: "Behruz Rushenas" <beh...@cp...> To: "Eric Nichols" <eni...@cp...>; <per...@li...> Sent: Friday, March 30, 2001 1:55 PM Subject: RE: Writing an LDIF to a variable? > Hi Eric, > > check out the next Web site , there is a great article about NET::LDAP by > MArk Wilcox. > There is alos an example with LDIF. > > http://www.perlmonth.com/features/ldap/ldap.html?issue=11 > > > Behruz > > -----Original Message----- > From: per...@li... > [mailto:per...@li...]On Behalf Of Eric > Nichols > Sent: Friday, March 30, 2001 10:48 AM > To: per...@li... > Subject: Re: Writing an LDIF to a variable? > > > No such luck. I tried everything. I guess there isn't a method in LDIF to > output to a variable? > ----- Original Message ----- > From: "Graham Barr" <gb...@po...> > To: "Eric Nichols" <eni...@cp...> > Cc: <per...@li...> > Sent: Friday, March 30, 2001 11:00 AM > Subject: Re: Writing an LDIF to a variable? > > > > It should be possible using the IO::Scalar package. > > > > Create the IO::Scalar object then > > > > my $ldif = Net::LDAP::LDIF->new($io_scalar,"w"); > > $ldif->write(@entries); > > > > should work, but I have not tried it > > > > Graham. > > > > On Fri, Mar 30, 2001 at 10:54:06AM -0500, Eric Nichols wrote: > > > This might have been asked before. > > > Is there any way I can take an Net::LDAP::Entry object and save it in > LDIF > > > format to a variable rather than a file? > > > > > > I'm sure there's some perl trick to it.. > > > > > > > > > > > > > > > > > > > > |