fix some perl compatibility