Using $/ is a nice esoteric idea requiring the person to really know perl in order to understand the code... but it won't work unless you already know that the file doesn't have the record separators. (In which case you wouldn't need chomp().) If I read the question correctly, the records themselves are 320 characters, not 319 characters plus a newline. If the file already has newlines, the first newline will become the first character in the second record and everything will get even more squirrely after that.
If you are going to use it, besides pre-determining the existence of newlines, I suggest use English; and $INPUT_RECORD_SEPARATOR as well as comments explaining the magic for the uninitiated.
-sauoq "My two cents aren't worth a dime."
In reply to Re: Re: Re: Re: Insert at regular increments
by sauoq
in thread Insert at regular increments
by EyeOpener
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |