Hello! Thank you very much for your responses. Yes, problems with 8 and 9 are very suspicious to be octal-decimal-problems ... but I didn't recognize it. After Paul's reply I solved this Problem by writing a small subroutine "DEC", that simply deletes leading zeros. So my substitution looks like: $a =~s/($s[0-9]+)/$b.&DEC($1)/ee; But Yitzchak's solution looks more elegant. May be it would be usefull to include some pragmas like "use decimal", "use octal" or "use numbase 'oct'" to ensure that only a certain base is used. (Or maybe there is already such a pargma, that I couldn't find in perlmodlib - base is something completely different). So an oktal fan could get a nicer output with something like this: use octal for (my $i = 06; $i<012; $i++) {print " $i";} (6 7 10 11 instead of 6 7 8 9) Greetings, Tobias