Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: Reversing a text by Word

Perl: Reversing a text by Word
{filelink=14823}

$text="Welcom to www.tubedir.com";
print("Before :n",$text,"
");
@myWords    = split(" ", $text);
#start reversing
$reversedWords   = join(" ", reverse @myWords);
# display the reversed text
printf ("After: %s",$mots_inverses);

No comments yet.

Leave a Comment