my $agent = 'PerlBeginnerPerl'; $agent =~ s/.([A-Z])/ $1/g; print $agent; #### $agent =~ s/(.)([A-Z])/$1 $2/g;