in reply to Directory Parsing

I guess that is the problem. I am not sure that the dataset will always be the second directory.
The directory structure most often looks like the APR21-TCCC-0003. The APR will always appear as standard the 21-TCCC-0003 can change but will always follow the convention of 2 alpha-numerics dash 4 alpha-numerics dash 4 alpha-numerics.
Thanks for any and all help on this.

Replies are listed 'Best First'.
Re^2: Directory Parsing
by GrandFather (Saint) on Sep 06, 2005 at 20:02 UTC

    In which case a regex is what you need.

    ($dataSet) = $dir =~ m|/(APR\w\w-\w{4}-\w{4}).*?$|;

    Note that \w matches A-Aa-a0-9_. If you need a subset of that range (upercase only for example), replace the \w's with something like [A-Z0-9].


    Perl is Huffman encoded by design.