http://www.perlmonks.org?node_id=992652

PriNet has asked for the wisdom of the Perl Monks concerning the following question:

After spending all day messing around with a "click and initiate file download" javascript plugin and finally getting it to (to the best of my recolection) work, it obviously uses an ajax method of some type to pass along information to another script (page) which I can see, using tests, is starting the second script correctly, but, I have tried reading the information passed to it by using

read(STDIN, $Header, $ENV{'CONTENT_LENGTH'});

and

$Header = $ENV{'QUERY_STRING'};

and get no results. The only thing the author provides is a way to retrieve the data using PHP. Well, besides knowing next to nothing about PHP, and not even sure if my server is setup to read PHP, I'm stuck. I have successfully used a standard form to upload a file, so I'm not a greenhorn. Can anyone give me the perl conversion of the folowing PHP script so I can use Perl to proccess the data? ANY help would be appreciated since PHP is a little out of my scope *heh*

<?php
$tmp_file_name = $_FILES['Filedata']['tmp_name'];
$ok = move_uploaded_file($tmp_file_name, '/path_to/new_filename');
echo $ok ? "OK" : "FAIL";

I did try re-inventing the wheel...
But it kept getting stuck on the corners