This is really more LDAP-specific than Perl-specific, but it's a bit of both as it has to do with how you're attempting to use the API provided by the module.
The compare method of Net::LDAP requires the distinguished name of the entry you're trying to compare against. You're comparing against your $base (is it still "dc=example,dc=com" (your LDAP base) at this point?) instead of the particular distinguished name you want "uid=srinivas,ou=People,dc=example,dc=com". There's no such attribute "uid" in entry "dc=example,dc=com", in case that's where you're looking.
What you probably mean to do is to do a search of entries for "uid=srinivas,ou=People,dc=example,dc=com" and then compare your hashed password to the hashed password there (and possibly also check the uid attribute as a sanity check).
BTW, you didn't just post an actual MD5 hashed Unix system account password to a public forum, did you? If so, you might want to change the password on that account and any others you have that use the same password. It takes some time to run a brute-force crack against MD5, but lots of people have nothing better to do than to put a cluster of four systems at work on it while they go about other things.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||