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


in reply to Re: print number of characters after specific character
in thread print number of characters after specific character

With your double split, rather than concatenation in a loop I'd go for join'ing an array slice, although substr seems more suited to the task.

$ perl -E ' $str = q{471234973798375754773971832374974447889743725345932}; say for map { join q{}, ( split m{} )[ 0 .. 9 ] } split m{47}, $str; say for map { substr $_, 0, 10 } split m{47}, $str;' 1234973798 7397183237 8897437253 1234973798 7397183237 8897437253 $

I hope this is of interest.

Cheers,

JohnGG