######################################################################################################## sub get_files_in_watched_directory { my ($directory_to_check, $project_name, $original_content_ref) = @_; my @problem_files; my @content_to_process; my $this_file; print "\n\nCalled Function: get_files_in_watched_directory"; print "\n Checking $directory_to_check"; chdir ($directory_to_check) || die "cannot chdir to directory $directory_to_check: $!"; # Get everything - files and directories - and decide what to do with each one opendir(DIR,$directory_to_check) || die "cannot open directory $directory_to_check: $!"; while (defined($this_file = readdir(DIR))) { my $full_file_name = $directory_to_check . '/' . $this_file; # ignore the special directories "." and '.." if ($this_file =~ /^\.\.?$/) { next } # wite anything else (file or directory) to an array to be processed later else { print "\n found: $this_file"; push (@content_to_process, $this_file) } } closedir(DIR); print "\n\nabout to retun"; #return @content_to_process; return (@{$original_content_ref}); }