There are so many things wrong with this, it is difficult to know where to start.

First, put <code> </code> blocks around your code so it will be easier for others to help you.

When you are developing a script, always

use warnings; use strict;

They will save you a lot of aggravation in the long run. You can comment them out after the script is finished, but during development, let the computer give you all the help it can.

Look into using the File::Basename module instead of regexes for getting the base file name.

You probably will want to use the $cgi->upload() function to handle the uploads.

If the FILELIST file is remote, (on the users hard drive as opposed to the servers,) you are going to have to upload that first before you can use it.

There are several places where you have two variables, equal to each other, where you perform the same transform operations on each. Useless added complexity.

In the output, you output a header with $cgi->header(), but then print out some more header elements, then the "text" of the page then open the BODY (twice!!) and close it again immediately.

I think you should work on writing a script that will upload ONE file, get it working reliably, and then work on expanding it to handle multiple files. I would also highly recommend reading the docs for the CGI module. Several times.


In reply to Re: Upload Multiple Files by thundergnat
in thread Upload Multiple Files by arun_amiable

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.