if you *really* feel like reinventing the wheel
Well, if you really must, at least make it short.
my $dir = "/htdocs/project1/docs/file.html"; my $parent = (split /\//, $dir)[-2];
In reply to Re: Re: Extract Name of Parent Directory
by cchampion
in thread Extract Name of Parent Directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |