Data validation is a real pain, but it's a huge help in preventing bugs. By using one system for validating data everywhere, the burden of validation is greatly simplified.
Rx is a schema language that can be used to validate data structures anywhere in your Perl programs. It integrates with Moose types, is extremely extensible, and is portable across languages: Rx implementations also exist in Python, Ruby, PHP, and JavaScript.