in reply to sub functions return array's

You are returning a reference to the array, not the array itself. That is a fine thing to do, but then you want to dereference it at the receiving end. Something like this:

sub getfiles() { opendir DIR,$logSite or die "Unable to open Directory, please try ag +ain"; foreach $pattern (@ARGV) { push (@uploads, grep /$pattern/, readdir(DIR)); } closedir DIR; return \@uploads; } my $aref = &getfiles; print @$aref; # or whatever