in reply to question on perl's split function

Unrelated to the rest of your question: chances are that the split doesn't do what you want it to, because it splits at the empty string.

Try this instead: my @arr = split m{/+}, $string;