homepage Welcome to WebmasterWorld Guest from 23.22.194.120
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
formatting perl code (literally)
irubin




msg:429995
 7:10 pm on Sep 4, 2003 (gmt 0)

Hello,

I am trying to work on a script that is one long line in its entirety with over 260,000 characters!

Is there a module or an application that can format the script so it will be human readable?

Thanks.

Roy

 

Damian




msg:429996
 10:43 pm on Sep 4, 2003 (gmt 0)

Hi Roy,

You could replace a character that occurs often (ie. the semicolon ';' which is usually at the end of a perl line ) with the same character and then a new line.

You'll need a text editor for this that can use 'regular expressions' in it's find/replace function(most I think, I use Textpad), possibly your html editor could do it as well (DreamWeaver can)

A new line in a regular expression is indicated by '\n' (without the quotes)

So when you replace
;
by
;\n

you would get something that looks a lot more readable. If not, just use a more suitable character then the semicolon. Remember to set the replace function to 'regular expression mode' or you would just put the literal \n in your code.

irubin




msg:429997
 10:49 pm on Sep 4, 2003 (gmt 0)

I managed to find a solution - a module called PerlTidy

Thanks.

Roy

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved