The following section of code does not work when there is a folder within the directory (as refered to in code). However, it does work when there is no other directory in the directory in code. So I guess the questions are: Why is this so? And. Can it be easily solved?
foreach my $job (read_dir("G:/Perl_program/Input")){
print "B\n";
next unless $job =~ /(.{36})\.txt$/;
my $tag = $1;