print substr($path, index($path, $magic_word)+length($magic_word)+1);
TIMTOWTDI :-)
print ((split q|/|,$path)[-1]);
regards
turo
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.
perlmonks.org content © perlmonks.org and azaria, Dietz, holli, turo, wfsp
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03