Created
May 22, 2009 17:28
-
-
Save mattmartini/116253 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
################################################################################ | |
################################################################################ | |
## perl_clean.pl - filter to clean up perl code ## | |
## ## | |
## ## | |
## ## | |
## ## | |
## Useage: ## | |
## ## | |
## Author: $Author: martini $ ## | |
## ## | |
## Created: 5/25/06 v.1.0 ## | |
## ## | |
## Revisions: ## | |
## $Log: perl_clean.pl,v $ | |
## Revision 1.1 2006/05/25 18:49:44 martini | |
## filter for BBEdit to clean (tidy) perl code | |
## | |
## | |
## ## | |
## ## | |
## ## | |
## Copyright: (c) 2006, Matt Martini ## | |
## ## | |
################################################################################ | |
################################################################################ | |
######################################## | |
# Requirements and Packages # | |
######################################## | |
use Perl::Tidy; | |
use constant VERSION => '$Revision: 1.1 $'; | |
######################################## | |
# Define Global Variables # | |
######################################## | |
my ( $program, $debug ); | |
$program = 'perl_clean.pl'; | |
$debug = 1; | |
######################################## | |
# Main Program # | |
######################################## | |
my $source = ''; | |
while (<>) { | |
$source .= $_; | |
} | |
my @destination; | |
Perl::Tidy::perltidy( source => \$source, | |
destination => \@destination ); | |
foreach (@destination) { | |
print; | |
} | |
exit(0); | |
######################################## | |
# Subroutines # | |
######################################## | |
__END__ | |
Put the following in your .perltidyrc file: | |
-ce | |
-lp | |
-cti=1 | |
-i=4 | |
-ci=2 | |
-pt=1 | |
-sbt=1 | |
-bt=1 | |
-bbt=1 | |
-nsfs | |
-nolq | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment