Always check CPAN! CPAN is the Comprehensive Perl Archive Network with hundreds of Perl modules that you can use for specific tasks.
There happens to be a Win32::AD module which looks like it'll do exactly what you want. (You're on Windows. Right? If not, you might have to fall back onto LDAP. Here's an example from Perl Monks.
I guess the question is how much Perl do you know. There's a Perl command called perldoc
which can be very useful. For example:
C:> perldoc Win32::AD
Will print out the documentation for the Win32::AD module. If nothing prints, you probably don't have the module installed. There's also another command called cpan
that allows you to download and specify the modules in CPAN you want. I don't know if you're on Windows, Linux, etc. and I don't know if you are on Windows whether you're using ActiveState or Strawberry Perl, so I can't give you more help than that.
If you're new to Perl, you might want to look at the Llama Book. This is an excellent beginning Perl book, My biggest complaint is that it doesn't do much in the way of Object Oriented Perl programming which has become extremely important in recent years.
I usually recommend that you go through the Perl 5 tutorials which will cover complex data structures (imagine having an array of hashes that contain other hashes). Then, once you understand how references work, go through the beginning tutorial on Object Oriented Programming.
If you can give us a few more details about your situation (Windows vs. Linux, how familiar you are with Perl, do you know CPAN, etc.) we can help you a bit more.