in reply to Re: Conditionally converting tabs to spaces
in thread Conditionally converting tabs to spaces
lhoward's looks more elegant, though. Make it use variable tabstops like so:my $tab = 8; while (<DATA>) { chomp; my @fields = split(/\t/, $_); my $cooked = shift (@fields) . join '', sprintf("-$tab%s", @fields +); print $cooked, "\n"; }
my $tab = 8; s/\t/" " x $tab/ego;
|
|---|