use strict;
use warnings;
use 5.010;
my $str = "The black cat climbed the green tree";
say rindex $str, "e"; # 35
say rindex $str, "e", 34; # 34
say rindex $str, "e", 33; # 29
It is like the index function but starts searching from the right-hand side. See also the explanation in String functions: length, lc, uc, index, substr.