in reply to sysread failure
To follow up on what brother Fletch said, sysread is really only something you'll need to use when munging a binary file. For any line-oriented file, just open the file and read it with open and the diamond operator while(<>){ .. }. And then close it, of course.
And don't worry that you have to read 8K blocks to get decent throughput -- the part of Perl that reads lines from files has had (from what I've heard) a great deal of attention paid to it over the last twenty or so years, and is probably about as fast as it could possibly be.
Also, seeing a repeated pattern in a regular expression should be a sign that there's probably a better way. Again, brother Fletch has suggested split. Try it -- I think you'll like it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sysread failure
by ikegami (Patriarch) on Aug 11, 2010 at 15:35 UTC | |
|
Re^2: sysread failure
by Anonymous Monk on Aug 11, 2010 at 14:04 UTC | |
by ikegami (Patriarch) on Aug 11, 2010 at 15:30 UTC |