You can use Test::File under the same terms as Perl itself.