use strict; use warnings; while () { chomp; s/,/\./; $_ *= 2 if $_; s/\./,/; print "$_\n"; } __DATA__ 1, 2,22 3,345