in reply to Re: strip substring from long string
in thread strip substring from long string

The leading dot-plus is unnecessary. In fact, you can just get all the non-slash characters leading up to the end of string:
($basename) = $a =~ m#([^/]+)$#;

Caution: Contents may have been coded under pressure.