Code: Perl
use strict;
use warnings;
use CGI;

my $cgi = new CGI;

## get all upload file input names
my @all_upload_files = grep { /^filetoupload_(\d+)$/ } keys $cgi->Vars;

foreach my $file_upload_name (@all_upload_files) {
    my ($filename) = $cgi->param($file_upload_name) =~ /([^\/\\]+)$/;
    ## append to filename/ or do whatever you want
    $filename .= '_' . $cgi->param('pusr');

    my $uph = $cgi->upload($file_upload_name);
    binmode $uph;
    open my $h, '>', "$filename" or die $!;
    while (<$uph>) {
        print {$h} $_;
    }
    close $h;

}