This would be more straightforward than the other suggestions:
my ($subpath) = $path =~ m|$magic_word/(.*)/.*|; print $subpath, $/;
Rereading the question, I misinterpreted it, since my solution will gather all directories after the magic word.
Go with wfsp's solution which fits in perfectly.
In reply to Re: regular expression for workdir
by Dietz
in thread regular expression for workdir
by azaria
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |