In general, though, you can do this sort of thing with a regular expression by using a character class that doesn't include the seperator. For example:
will grab everything up to the last slash.if ($path =~ m|^(.*)/[^/]*$|) { $dir = $1; }
In reply to Re: match only last character of a kind
by sgifford
in thread match only last character of a kind
by duc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |