Support implementing __cmp__ in Perl

This allows overriding equality comparison of Perl objects in Python
code.