[DAS] "DAS/0.5" -- a different way of doing it

Ian Holmes ihh@fruitfly.org
Fri, 21 Dec 2001 12:37:42 -0800 (PST)


Lincoln, another thing is that you might want to take a leaf out of Ward
Cunningham's wiki, and convert spaces to tabs if they're outside quotes

e.g. (prolly not the most efficient way of doing it)

my $c = "\261";   # define a safe cursor delimiter
$_ = "$c$_";  # stick the delimiter at the start of the text

while (s/$c([^\" ]*)( +)([^\" ]*)/$1\t$3$c/    # convert spaces to tabs,
       || s/$c(\"[^\"]*\")/$1$c/g)          # sweeping cursor past quotes
 {}

s/$c//;   # get rid of cursor

-- 
Ian Holmes  ....  Howard Hughes Medical Institute  ....  ihh@fruitfly.org