There's nothing magic about a test. Read the files in, check they have the right contents. Bog simple.
open my $fh, $file;
my $have = join '', <$fh>;
is $have, <<'WANT', "contents of $file";
The quick brown fox
jumped over the lazy grey dog.
WANT
Nothing ground breaking there. Test::File::Contents will provide you with some utility functions so you don't have to write that over and over again.
If you're testing a bunch of files, you can make the process data driven.
my %file_tests;
$file_tests{"expected_filename"} = <<'WANT';
Expected content
WANT
... and so on ...
for my $file (keys %file_tests) {
my $want = $file_tests{$file};
file_contents_is($file, $want, "contents of $file");
}
If the contents are large you may want to stick the expected output into files and use files_contents_identical().
Finally, if you want to make sure the program ONLY produced the files you expect and there are no strays, make a temp directory, chdir into that, run the program from there, and check the directory only contains the files you expect. I'll leave that as an exercise for the reader.