Welcome to WebmasterWorld Guest from 54.158.212.93

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

formatting perl code (literally)

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

Junior Member

10+ Year Member

joined:Jan 1, 2003
posts:53
votes: 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

10:43 pm on Sept 4, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 19, 2000
posts:366
votes: 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.

10:49 pm on Sept 4, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 1, 2003
posts:53
votes: 0


I managed to find a solution - a module called PerlTidy

Thanks.

Roy

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members