in reply to How to wrap text to a maximum width of 70 characters per line?

It's not exactly clear what you're trying to do, but here are a couple of possibilities:

If you only want to show the first 70 characters of each line then read the lines in one at a line and use substr.

If you want to reformat the paragraphs so that they are no more that 70 characters wide, then read the whole paragraph in and reformat it using Text::Wrap.

Originally posted as a Categorized Answer.

  • Comment on Re: How can I get perl to print a max. # of 70 characters per line from a file