What is the Perl equivalent for PHP $ _FILES for file uploads?

What is the Perl equivalent of PHP $_FILES? I have software that sends log files to a web server, and I need to get them using Perl instead of PHP. I am using CGI.pm.

Here is the code in PHP:

<?
    foreach ($_FILES as $key=>$value)
        {
         $uploaded_file = $_FILES[$key]['tmp_name'];
        }
?>
+3
source share
1 answer

In pod :

my $q = CGI->new();

# get filehandle like objects from the query. 
my @uploaded_files = $q->upload();

# get file by name
my $fh = $q->upload('uploaded_file'); 
+12
source

Source: https://habr.com/ru/post/1702710/


All Articles