You might be interested in the Lingua::LinkParser module. I don't know if it can be used to determine whether a sentence is grammatically correct, but it's a fascinating module nonetheless.
Dan Brian had an article on the module in issue #19 of http://www.tpj.com. (Past articles are not back up on the TPJ website yet.)