Rewrite ceh_exclude in Perl