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

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

Hi monks

I have been trying to figure out how to do something. Basically, i want to split a string into pieces of 2 characters each. An example:

$mystring = "perl monks" The output should be:

$my_splitted_string = "pe er rl mo on nk ks"

From this i want to show that each word should be split in 2 character words with the last character of a word being the first character of the next word.

Thanks for reading this