Convenient type matching for Perl