http://www.perlmonks.org?node_id=1025122

Priti24 has asked for the wisdom of the Perl Monks concerning the following question:

I have a sring like $string = "abcdefghi"; i need to reverse the string in place i.e without using any other array or built-in function. The algorithm used for this is swapping the numbers like below:
function reverse_in_place(a[0..n]) for i from 0 to floor(n/2) tmp := a[i] a[i] := a[n - 1 - i] a[n - 1 -; i] := tmp
Can you please tell me is there any regular expression that can be used to reverse the string or any perl code will be helpful. Thanks in advance.