in reply to Directory Parsing

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");

Replies are listed 'Best First'.
Re^2: Directory Parsing
by Fletch (Bishop) on Sep 06, 2005 at 19:59 UTC

    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).

    --
    We're looking for people in ATL

Re^2: Directory Parsing
by xorl (Deacon) on Sep 06, 2005 at 19:39 UTC
    If $DataSet should always be the 2nd directory, you can try something like
    @array_split = split("/\//", $dir); $DataSet = $array_split[1];