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].
In reply to Re^2: Directory Parsing
by GrandFather
in thread Directory Parsing
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |