CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Multiple uploads


New User

Aug 2, 2009, 6:07 PM

Post #1 of 2 (466 views)
Multiple uploads Can't Post

This is a perl script that uploads files and writes to a temp file so i can get the percentage uploaded. It works fine for one file, but if I load the script while one is already uploading, it pauses the first file and starts the second..

Here are the relevant lines:

my $i=0;

$ofh = select(TMP); $| = 1; select ($ofh);

while (read (STDIN ,$LINE, 4096) && $bRead < $len )
$bRead += length $LINE;
print TMP $LINE;

close (TMP);

Even if I'm calling two different perl scripts(identical) writing to two different files in two different folders.. some help would be appreciated

the site I'm building it for can be viewed at :, or if thats not up yet,
- Nick


Aug 5, 2009, 6:31 AM

Post #2 of 2 (444 views)
Re: [cammarata123] Multiple uploads [In reply to] Can't Post

I will guess it has to do with the filhandle you ar creating.

When running select(TMP) I will think you are connecting into the already existing filhandle.

Have you tried giving it a unique name for everytime you run the script? Ex. adding a timestamp to it, or a sequence number.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives