#!/usr/bin/perl use strict; use warnings; my $dir_path="Your Directory Path"; opendir (DIR, $tmp_dir) or die $!; #### open (MYFILE, '>>data.txt'); #### while (my $file_name = readdir(DIR)) {print "$file_name\n";}