in reply to Re: Re: Re: Insert at regular increments
in thread Insert at regular increments
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."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Insert at regular increments
by EyeOpener (Scribe) on Jul 23, 2002 at 00:13 UTC | |
|
Re: Re: Re: Re: Re: Insert at regular increments
by broquaint (Abbot) on Jul 23, 2002 at 13:37 UTC | |
by Aristotle (Chancellor) on Jul 23, 2002 at 14:12 UTC | |
by sauoq (Abbot) on Jul 23, 2002 at 19:21 UTC |