A file upload script of this nature is not hard to put together. I do suggest that you include A LOT MORE security checks than described... Checking extensions is only the beginning. Your upload script should verify that the file uploaded is indeed THAT file type. In other words, your Perl script should use some of the built in features to verify that a jpg file is really a photo. Word Docs are really Word docs... Etc., etc.
I highly suggest developing a customized uploader in Perl rather than depending on what is available at CPAN.org, but there are Perl modules that will accomplish what it is you want. (File renaming, temp directories, etc.)
The many modules that I have studied over the years have *problems* but they require a person who is really out to get you to exploit.
Your script should also verify that ONLY people you have given permission to (registered users, IP ADDRESS based, etc.) are allowed to upload anything.
Your script should only allow file names of say tr/a-zA-Z_0-9./
Your script should limit the number of characters in the file name.
Your script should not allow uploaded files to be viewed/hot-linked by outsiders.
Your script should be able to send you an email when a user uploads a file (Or at least keep a log of usage.
There are a few Major security checks but it borders *unethical* practices...