while (<>) { my @csv = split /,/; s/\b0+(?=\d)//g for @csv[0,2]; print join(',', @csv), "\n"; }