Try this...
$path =~ s{ /log/ .* \z }{/}xms;
Note that if your path has "/log/" in it twice or more, this will strip off everything after the first one. If you want to strip off everything after the last one, this seems to work:
$path =~ s{ (.*) /log/ .* \z }{$1/}xms;
In reply to Re: Manipulating directory paths
by kyle
in thread Manipulating directory paths
by pp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |