$ perl -e '$s="JustAnotherPerlHacker\n"; $s=~s/(?<=.)(?=[A-Z])/ /g; print $s' Just Another Perl Hacker #### $s=~s/(?<=\S)(?=[[:upper:]])/ /g #### $ perl -e '$s="JustAnotherPerlHacker\n"; @a = split /(?<=\S)(?=[[:upper:]])/, $s; print "@a"' Just Another Perl Hacker