Skip Menu |

This queue is for tickets about the DBD-LDAP CPAN distribution.

Report information
The Basics
Id: 63907
Status: resolved
Priority: 0/
Queue: DBD-LDAP

People
Owner: turnerjw784 [...] yahoo.com
Requestors: mivkovic [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.20
Fixed in: (no value)



Subject: DBI->data_sources() doesn't seem to work
The documentation mentions: DBI->data_sources() The `data_sources' method returns a list of "databases" (.ldb files) However, all I get is a a usage message: $ perl -MDBD::LDAP -e 'print DBI->data_sources();' usage: DBI->install_driver($driver [, %attr]) at -e line 1 Trying to add the suggested install_driver doesn't help: $ perl -MDBD::LDAP -e 'DBI->install_driver("LDAP"); print DBI->data_sources();' usage: DBI->install_driver($driver [, %attr]) at -e line 1 I don't know if it's a bug or if it's just the documentation that is incomplete.
On Tue Dec 14 11:21:13 2010, MIVKOVIC wrote: Show quoted text
> The documentation mentions: > > DBI->data_sources() > The `data_sources' method returns a list of "databases" (.ldb > files) > > However, all I get is a a usage message: > > $ perl -MDBD::LDAP -e 'print DBI->data_sources();' > usage: DBI->install_driver($driver [, %attr]) at -e line 1 > > Trying to add the suggested install_driver doesn't help: > > $ perl -MDBD::LDAP -e 'DBI->install_driver("LDAP"); print > DBI->data_sources();' > usage: DBI->install_driver($driver [, %attr]) at -e line 1 > > I don't know if it's a bug or if it's just the documentation that is > incomplete.
Looks like the LDAP docs are alittle off - from "http://search.cpan.org/~timb/DBI/DBI.pm#data_sources": "@ary = DBI->data_sources($driver, \%attr);" Therefore, try (works for me): perl -MDBD::LDAP -e 'DBI->install_driver("LDAP"); print DBI->data_sources("LDAP");' -- or better yet (since it returns an array) -- perl -MDBD::LDAP -e 'DBI->install_driver("LDAP"); print join(" ",DBI->data_sources("LDAP"));' I'll fix the docs for the next release. Thanks & Cheers! Jim Turnet
Works for me too. Really should have found that myself instead of blindly relying on copy/paste. Your module was immensely helpful today to add LDAP users and groups to PostgreSQL. Thanks a lot!