From: Eric N. <eni...@cp...> - 2001-03-30 19:36:21
|
No such luck, I got it to work, except IO::Scalar dosen't support the TELL function? Can't locate object method "TELL" via package "IO::Scalar" at C:/Perl/site/lib/Net/LDAP/LDIF.pm line 169. Source code: --- use Net::LDAP::Entry; use Net::LDAP::LDIF; use IO::Scalar; my ($destentry) = Net::LDAP::Entry->new; $destentry->add('cn'=>['Eric Nichols']); $destentry->dn('cn=eric nichols,o=cps'); my $s; tie *OUT, 'IO::Scalar', \$s; my $ldif = Net::LDAP::LDIF->new(\*OUT,"a"); $ldif->write($destentry); $ldif->done(); print $s; --- ----- 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.. > > > > > > > > > > |