perl-docs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject untabify script
Date Thu, 21 Feb 2002 12:11:24 GMT
Stas Bekman wrote:

> just remember to untabify your files if you are still using real tab char:
> 
> % cat ~/bin/untabify.pl
> #!/usr/bin/perl -pi
> s/\t/' ' x (8 - length($`) % 8)/eg;

In fact this script is not good, because it doesn't handle correctly 
adjucent tabs and we want 4 chars indent, so use this one if your editor 
doesn't do the write thing in first place.

This one seems to do the work much better:


#!/usr/bin/perl -pi
BEGIN {use Text::Tabs; $tabstop = 4;}
$_ = expand($_);




_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Mime
View raw message