in reply to File::Find problem
$sourcefile = $_ if -f and /$datfile/;If your intent was to add new file to @sourcefiles array, it would not work. You should use...
...instead.push(@sourcefiles, $_) if -f and /$datafile/i;
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:
BRopen(my $fh, '<', $File::Find::name) or die "Can't open $File::Find::n +ame: $!"; my $source = do { local $/; <$fh> }; close $fh;
|
|---|