# put commas in the right places in an integer 1 while s/(\d)(\d\d\d)(?!\d)/$1,$2/g; # expand tabs to 8-column spacing 1 while s/\t+/' ' x (length($&)*8 - length($`)%8)/e; #### my $foo = ':{,"'; 1 while $foo =~ s/([:,{])(?! )(.)/$1 $2/; print ">$foo<\n"; #### 19:22 >perl 1872_SoPW.pl >: { , "< 19:22 >