Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 15th, 2007, 1:43 AM   #1
TheMuffenMann
Newbie
 
Join Date: Jan 2007
Posts: 4
Rep Power: 0 TheMuffenMann is on a distinguished road
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;
}
TheMuffenMann is offline   Reply With Quote
Old Feb 15th, 2007, 3:46 AM   #2
iradic
Programmer
 
Join Date: Feb 2006
Posts: 36
Rep Power: 0 iradic is on a distinguished road
IMHO it will not do what you want...
iradic is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC