For a plain-text thesaurus, the Gutenberg Roget's is available, but in a pretty nasty format :) Check out
Lingua::Wordnet though, the interface to
Wordnet which is a very comprehensive hierachical thesaurus / dictionary system. A couple more modules have appeared recently too -
Wordnet::Similarity and
Wordnet::QueryData - I haven't tried them out myself, but one of these is sure to fit your needs.
Cheers, Ben.