in reply to EBCDIC File I/O

Why mess with a read or sysread?
while(<ORIGINAL>) { chop $_; print NEWFILE $_; }

Replies are listed 'Best First'.
Re^2: EBCDIC File I/O
by djp (Hermit) on May 18, 2006 at 03:42 UTC
    Because it's a fixed-width file, with no line terminators. This will work however (as a filter):
    local $/ = \5201; while (<>) { chop; print; }
    'man perlvar' for details.
Re^2: EBCDIC File I/O
by rodion (Chaplain) on May 18, 2006 at 03:46 UTC
    He would not want to use a simple "while (<ORIGINAL>) {" because newline is different for EBCDIC. It's 0x15 instesd of 0x0A, so the lines don't come out right. (One could always set $/, the input record separator, but if the records are fixed length the choice between setting $/ and using a fixed length read would be a matter of clarity and/or taste. IMO.)