corrected perl script
changed a couple of things