Something about this raises the "X/Y problem" hackles and makes me want to mumble something about using File::Spec and splitdir to break things up into a list of directory components instead (or Path::Tiny and doing . . . something). Or it could just be Monday and I'm making arbitrary connections that aren't there.
That aside the previous quotemeta answer(s) obviously fixes the X issue.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re: How to remove everything after last occurrence of a string?
by Fletch
in thread How to remove everything after last occurrence of a string?
by ovedpo15
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |