in reply to Re: String matching problem
in thread String matching problem

substr($string, -1) will return the last character in $string.
As does chop $string. I think that's the first time I've used chop.