in reply to subroutines and returning lists...

Hello, Look at the below code, it returns an array from a sub.
@array = ("hi","hello"); @final_array = match_files(\@array); sub match_files { push(@files, "hola", @array); return @files; } for (@final_array) { print; }
Your problem is you are storing the results of the sub which are an array into a scalar varialble.