[plug] Perl query: Counting letters in a string.

Leon Brooks leon at brooks.fdns.net
Thu Feb 20 21:01:44 WST 2003


On Thursday 20 February 2003 04:41 pm, David Buddrige wrote:
> I need to write a perl program that will identify any lines in a C++ source
> file that are > 80 characters long, and chop them into 2 lines at an
> appropriate point in the string.

Man fold? (-:

fold -s filename would work in the majority of cases, and most of the 
remainder could be fixed by appending a \ to lines with a single set of 
quotes in them (sed could do it, but my brains are too worn to work out the 
regexp for dtecting just-one-quote lines).

Cheers; Leon



More information about the plug mailing list