use strict; use File::Spec; print "File Name?\n"; my $ToBeDeleted = ; chomp $ToBeDeleted; open(IN, $ToBeDeleted) or die " The file $TheFileToBeDeleted .....Missing In Action.\n"; my @arr = ; chomp @arr; print "Directory where files are located?\n"; my $Path = ; chomp $Path; foreach my $file (@arr) { my $x=File::Spec->catfile($Path, $file); unlink $x; }