Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl script optimization

Status
Not open for further replies.

goliath

MIS
Aug 18, 1999
62
US
Hello,

I have a perl script written up but would like to reduce the size as much as possible. Are there any utilities to pull out unneeded tabs, white space, etc.

Thank you, Alec
 
Sounds to me like you need a perl script.[wink]

A perl script to do that should not be that hard to write. I'd do it in two passes.

On the first pass, I'd remove all comments, any whitespace that appears at the beginning of each line, and any whitespace on either side of a parenthesis or math symbol.

On the second pass I'd remove any hard return that does not appear inside quotes.

Perl's very forgiving about whitespace in source code, but I would keep a copy of the original in a safe place.
 
I had hoped to find such a script already out there ;) Maybe part of an obfuscation project or something.

I found a retail product called "ShroudIT" but thats rather pricey. =
Thanks for the input!

 
get TextPad from and you can run regular expression straight from the find/replace box. Not PCRE :( but a variation on it.

V useful to any coder (syntax highlighting too :) --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top