in reply to Re: The One True Style of indentation:
in thread The One True Style of indentation:
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.#!/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;
_____________________________________________________
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:??;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re3: The One True Style of indentation:
by blakem (Monsignor) on Apr 15, 2002 at 03:15 UTC | |
by hsmyers (Canon) on Apr 16, 2002 at 11:53 UTC |