#!/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); }