I'm a missing something? It seems to me this is a perfect
target for split. You only have
(if you are sure you always begin and end with 'x') to check
for empty strings. Or join rightaway.
$str='xjxexrxoxexnexsx';
print join '', split /x/, $str; #prints my monkname