From: Naftel, B. S <bs...@so...> - 2002-03-26 16:15:15
|
The single quote marks don't allow substitution bs...@so... 850.968.7764 -----Original Message----- From: Kristina Hildebrand [mailto:khi...@om...] Sent: Tuesday, March 26, 2002 10:19 AM To: per...@ma... Subject: Filter Strings Hello, I am a fairly new Perl programmer (a few weeks), and am working on integrating our LDAP directory with another database. I seem to be having problems with my filter string in one particular instance. I'm thinking that it has to do with the fact that I'm trying to use a variable in my filter string. I know that the DBI module has the ability to bind variables when you execute the SQL statement. Does the search method of the LDAP module have something similar I can't figure out? Here's the code that seems to be giving me trouble: my $mesg =3D $ldap->search(...,filter =3D> 'uid=3D$item', ...) die ($mesg->error) if $mesg->code; #put the attributes in a hash table my %user; my $entry =3D $mesg->entry; #the following line is the one giving me trouble, saying I can't execute the #attributes method on a null value. I figure this is because it's not finding any #entries where uid equals "$item" foreach my $attr ($entry->attributes){ $user{$attr} =3D $entry->get_value($attr); } This code works perfectly when I have "...filter=3D> 'uid=3Dkdhilde'..." Please respond to me directly, as well as the list, because the message that I sent to per...@ma... to subscribe to the list bounced back. Thank-you very much, Kristina Hildebrand |