use strict; use warnings; my $cwd = getcwd; my @file_list; my $res = _list_files($cwd, \@file_list); # definition of _list_files($cwd omitted)