Yes! Another believer! Oh, and here's a utility script of mine, detab:
#!/usr/bin/perl -pi
# can't use die() in BEGIN -- it looks funny :(
BEGIN { $sp = shift or warn("usage: detab SP files...\n") and exit }
s/^(\t+)/" " x ($sp * length $1)/eg;
To cleanse your nasty tabbed files, simply run detab 2 foo.pl, and your leading tabs are replaced with 2 spaces per tab. The way japhy intended.
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??; | [reply] [d/l] |
A slightly different way to do that:
perl -pi -e 's/\G\t/ /g' foo.pl
(Adapted from a "replace-leading-zeros-with-spaces" oneliner
I seem to remember)
Update: looks like the original came from merlyn after dominus offered a suggestion similar to japhy's
-Blake
| [reply] [d/l] |
Ummm-- I think that was a 'dictum', not a suggestion...
–hsm
"Never try to teach a pig to sing…it wastes your time and it annoys the pig."
| [reply] |