Additionally, this specific task can be solved by making use of the built-in
reverse function, which, in a scalar context, reverses the string character-wise, which seems to be what you want. Also read
perlfunc.
Originally posted as a Categorized Answer.