With a regex, I'd do this, but I would ordinarily use File::Basename to do this:
my ($parent) = "/dir1/dir2/dir3/ .. /dirLast//" =~ m#^(.*)/.*?//$#;
In reply to Re: Parent directory - regex
by pbeckingham
in thread Parent directory - regex
by jevon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |