in reply to 80 characters long
Sounds like this guy has to write stuff to make an IBM mainframe or other hunk of old iron happy (been there, done that).
What you could try (with no guarantees of success ;-) ) is to set local $/ = 80;. This will read the file in chunks of 80 bytes (note that the docs say bytes, but beware that "byte" and "character" are sometimes used interchangeably). You could also try working with sysread, which has an option to read a specific number of bytes.
I'm sure somebody will (or has) come up with a way to do this in a single line with a regex, but my regex mojo is not in that realm.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 80 characters long
by ikegami (Patriarch) on Sep 27, 2007 at 21:37 UTC |