The String::Parity module for perl5 may be used to generate and test
even, odd, mark and space parity on arbitrary strings.

WWW: http://search.cpan.org/dist/String-Parity/