in reply to how do I line-wrap while copying a file to stdout?

Try:

print join "\n", unpack("A80" x (length($l) / 80 + 1), $l);

Replies are listed 'Best First'.
Re: Re: how do I line-wrap while copying a file to stdout?
by ams (Initiate) on Apr 20, 2001 at 11:35 UTC
    this seems to be missing one newline per group of lines. And lines short than 80 characters also print, missing the newline.
    -allan