in reply to sub functions return array's

It would be helpful to see the calling syntax, in this case you are passing back an array reference (a scalar), which must be utilized as such by the caller. That is, if you want to use the list you must dereference it.
my $uploads = getfiles(); for my $uploaded_file (@$uploads) { print "Filename: $uploaded_file\n"; }
Alternatively you can actually return a list of values (don't use backslash to create a reference before returning):
...snip... return @uploads; } my @uploads = getfiles()