in reply to read files one by one in directory and redirct output to a file

Given your loose spec, this is pretty trivial for Path::Tiny.

#!/usr/bin/env perl use strict; use warnings; use Path::Tiny; my $out = path ('output.txt'); for my $file (path ('logs')->children) { $out->append ($file->slurp); }
  • Comment on Re: read files one by one in directory and redirct output to a file
  • Download Code