On 30/08/2011 10:38, Narasimha Madineedi wrote:
Hi all,
I have a string like *"abcd efgh ijkl mnop"* i want to reverse the string
like this "*dcba hgfe lkji ponm*"
can any one tell me how to get the required output?
thanks in advance......
Like this perhaps?
use strict;
use warnings;
my $str = "abcd efgh ijkl mnop";
print join ' ', map scalar reverse($_), split ' ', $str;
__END__
**OUTPUT**
dcba hgfe lkji ponm
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/