#!/usr/bin/perl use strict; use warnings; my $dir_path="c:/incoming/temp;" opendir my $DIR, $dir_path or die $!; open my $OUT, '>>', 'c:/vehicles.txt' or die $!; while (my $file_name = readdir($DIR) {print "$file_name\n";} print MYFILE $file_content; close (MYFILE)