fix perl script