use strict; use warnings; my $allDevices = 'All_Devices.txt'; open (my $device_h, '>>', $allDevices) or die "Could not create $allDevices $!\n"; while (my $file = <$_allConfDir/*>) { print $device_h $file; } close $device_h; #### next uness ($file =~ m/\.txt$/); #### <$_allConfDir/*txt>