in reply to 80 characters long

What do you want to do with long lines? Wrap them? Text::Wrap.

Replies are listed 'Best First'.
Re^2: 80 characters long
by aixmike (Novice) on Sep 27, 2007 at 18:15 UTC
    Not wrap them, but write them to seperate lines (carriage return at column 81) Please if what I am asking does not make sense, let me know, I will try yo explain it another way.

      That's what wrapping means.

      ...Although Text::Wrap will only break on a word boundary. Did you want to break at colomn 80 unconditionally, even if it's in the middle of a word?

      $text =~ s/(.{80})(?!$)/$1\n/gm;
        Thanks, here is what I have from the examples
        use Text::Wrap $Text = "C:\\ACK_DATA\\ar835.dat"; open(IN,$a) || die "cannot open $a for reading: $!"; $Text::Wrap::columns = 80; print wrap('', '', @Text);
        but I get an error ""C:\ACK_DATA\ar835.dat" is not exported by the Text::Wrap module Can't continue after import errors at perl-form.pl line 3 BEGIN failed--compilation aborted at perl-form.pl line 3."