in reply to String Length

Assuming that you want to remove a trailing "ST", use a regex. This'll protect you against the day when, unexpectedly, something other than "ST" sneaks in to your input stream.  ($stripped = $string) =~ s/ST$//;