Using Net::LDAP::LDIF

Michael Fowler wolfm at pobox.alaska.net
Fri May 5 14:42:43 CDT 2000


On Fri, May 05, 2000 at 11:05:27AM -0800, Roxanne Reid-Bennett wrote:
> Has anybody here used this package, and have a handy example?

Well, no, not really, but I may be able to help anyways.


> I'm getting an error that kind-of makes sense, and kind-of doesn't.
> 
> perl code:
> 	Net::LDAP::LDIF->new(\*STDOUT,"w")->write($mesg->entries);  
> error message:
> 	Can't locate object method "new" via package "Net::LDAP::LDIF" at ldap.pl line
> 33.                                                                             

This error usually means you either haven't loaded the Net::LDAP::LDIF
module (and thus didn't load any of the methods), or that the
Net::LDAP::LDIF module really doesn't have that method.

After taking a look at the module, and testing the new method, I see it
-does- have the method, so I'm inclined to thing it's the former (that you
didn't load the module).


> I've tried breaking that line into two statements, the new and then the
> write, but the same error occurs for the "new".  The only thing that makes
> sense to me is that the (\*STDOUT, "w") doesn't match the footprint for
> the constructor which should be : new ( [FILE [, MODE]] )

No, that wouldn't do it.  The only enforcement of a subroutine's arguments
is through the prototyping mechanism, and prototyping doesn't work for
methods (AFAIK).

 
> And at the moment I don't even remember where I found the example for
> writing out the ldap entries resulting from a query.

Well, Net::LDAP may be more appropriate for this (I'm not sure what exactly
you're doing, and I'm not terribly familiar with the whole ldap thing).  The
synopsis for the module shows what appears to be a good example of doing
exactly that.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--
=================================================
Mailing list info:  If at any time you wish to (un|re)subscribe to
the list send the request to majordomo at hfb.pm.org.  All requests
should be in the body, and look like such
                  subscribe anchorage-pm-list
                  unsubscribe anchorage-pm-list



More information about the Anchorage-pm mailing list