I definitely suggest you check out
Sex,
Eger!, my paper (soon to be at perl.com!) on reversing
regular expressions to match the last of something in a
string.
If you want to match forward, then you want to match the
last sequence of non-. characters in a string. This can be
matched by ($ext) = $str =~ /([^.]+)$/.
If you want to reverse it, simply do $ext = scalar reverse(
reverse($str) =~ /([^.]+)/).