in reply to set permissions automatically

Okay, wolverina, now that you know the how, it's time to deal with the whether. Please consider the security implications of letting someone upload a file and, just because it has a .pl extension, automatically making it executable. Who gets to upload such a file? Where does it get written? Who gets to execute the code once uploaded? What if the code is malicious? It seems like such a small thing, but setting permissions in such a way can open a Pandora's box of tribulation. Please be careful.