you can try Crypt::Cracklib, although you're going to spend alot of CPU cycles on this. Especially if you're using a "modern" unix that uses triple-des passwords (or even better, a MD5 hash of a 3DES encrypted string). You'd be better off trying the rubber-hose method...
note: the rubber hose comment was a joke, of course...
Disclaimer: This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.