in reply to File::Find problem

Besides all of the above mentioned issues with your code, you may also take a close look at this line
$sourcefile = $_ if -f and /$datfile/;
If your intent was to add new file to @sourcefiles array, it would not work. You should use...
push(@sourcefiles, $_) if -f and /$datafile/i;
...instead.

If, on the other hand, you wanted to slurp the content of the $File::Find::name file into a variable, then you should use something like this:

open(my $fh, '<', $File::Find::name) or die "Can't open $File::Find::n +ame: $!"; my $source = do { local $/; <$fh> }; close $fh;
BR