After your loop the last line read is still in $_, so you can use
@path = split(/\//, $_); $importantdir = $path[-3];
the negative index in the array counts from the end of the array rather than the beginning.
-- Brigitte 'I never met a chocolate I didnt like' Jellinek http://www.horus.com/~bjelli/ http://perlwelt.horus.at
In reply to Re: parsing
by bjelli
in thread parsing
by amoura
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |