![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Jan 2007
Posts: 4
Rep Power: 0
![]() |
got lazy writing C code...alas! a perl script for formatting
well..usually i use hard tabs with a default width of 8, for writing C code, but recently i've adopted a 4 space indent width instead..there's no way in hell im gonna type 4 spaces for every level of indentation, so threw together a quick perl script (i'm actually quite new to perl as far as using it alot goes) so that i can be lazy and use hard tabs when coding, then run the source code through this script and have it indented right. anyways, here it is..it's quite small:
#!/usr/bin/perl
$^I = ".bak";
while (<>) {
s/\t/ /g;
print;
}
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2006
Posts: 36
Rep Power: 0
![]() |
IMHO it will not do what you want...
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with Perl script | eclipsed4utoo | Perl | 1 | Dec 2nd, 2005 1:33 PM |
| Convert Python script to C++ code | clanotheduck | Python | 17 | Sep 25th, 2005 8:55 AM |
| A simple perl script | satimis | Perl | 3 | Aug 15th, 2005 9:31 AM |
| HELP!!! Perl script to display drop down menu on webpage | domquem | Perl | 8 | Jun 2nd, 2005 9:48 AM |
| help writing script to read files names | technett | Bash / Shell Scripting | 2 | Apr 26th, 2005 1:38 PM |