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

Have you thought about using File::Spec->catfile instead?