Monks. Since I have passed /TC/APR-TCCC-0003/APR21-TCCC-0003 into $dir what I want to further do is pass APR21-TCCC-0003 into $dataSet so that I can print $dataSet out in an error file like, print( DbFile "DATASET BEING TESTED IS $DataSet\n\n");
See perldoc File::Basename; one of fileparse or basename might be what you're looking for (although you've still got a somewhat vague problem statement there).