in reply to Re^2: Get last occurence of a character in a string
in thread Get last occurence of a character in a string

You're giving the opposite of what was asked for
Yes, you're right. I misread the OP's question.

and you should escape your backslashes
Sure?
my ($file) = ($path =~ /([^//]*)$/);

Unmatched [ in regex; marked by <-- HERE in m/([ <-- HERE ^/