I re-did the code to match you're strategy, cause I am not against changing what I am doing. This is my first time with Perl/LDAP and it is a time pressed issue so I really appreciate all you're help and guidance. After re-writing the code it is still experiencing the same issue. Here is the new code.
sub ldapsearch {
my $mac = shift;
print "$mac\n";
my $searchobj = $connection->search(
base => 'o=ldap',
scope => 'sub',
filter => "cn=$mac",
attrs => @attrs, #note I al
+so tried \@attrs
);
$searchobj->code && die $searchobj->error;
while ( my $entry = $searchobj->shift_entry) {
print $entry->dn, "\n";
print $entry->get_value('plan');
print $entry->get_value('ipaddress');
print $entry->get_value('username');
}
}
Any suggestion ?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|