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


in reply to Replacing matches within string without splitting.

Use lookahead:

$t = "1,2,3,4\n8,9,10,11\n7,8,9,10,\n12,13,14,15\n";; print $t;; 1,2,3,4 8,9,10,11 7,8,9,10, 12,13,14,15 $t =~ s[(\D|^)(?=\d(?:\D|$))][${1}0]g;; print $t;; 01,02,03,04 08,09,10,11 07,08,09,10, 12,13,14,15

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.