fork download
  1. my $g_tab_width = 4;
  2.  
  3. my $s1 = "xxxx\tyyyy\tzzzz";
  4. $s1 =~ s{(.*?)\t}{$1.(' ' x ($g_tab_width - length($1) % $g_tab_width))}ge;
  5.  
  6. my $s2 = "xxxx\tyyyy\tzzzz";
  7. $s2 =~ s/(.*?)\t/$1 /g;
  8.  
  9. print $s1, "\n", $s2, "\n";
  10.  
Success #stdin #stdout 0s 4596KB
stdin
Standard input is empty
stdout
xxxx    yyyy    zzzz
xxxx    yyyy    zzzz