More fixes and tune-ups for Perl