thor has asked for the wisdom of the Perl Monks concerning the following question:
My ongoing attempt at creating a PerlIO::via interface to an old module that I had laying around is actually getting somewhere. However, I've run up against a bit of a stumbling block.
The format that I'm trying to read is not new-line delimited, but is rather a 2-byte exclusive rdw format. What this means is that for every record, there are two bytes that prefix it that says how long that record is. I've written a subroutine that deals with this. When called from the old OO interface, it does as I expect it would: it returns one record. However, when I write a thin wrapper around it and call it as FILL (see PerlIO::via for details), it seems to be hung up looking for a newline character which may or may not be there. This causes the program to read in multiple records which is not what I want it to do. Is there any way to tell perl that "yes...even though there is no newline character at the end, you have the entire record"?
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PerlIO::via FILL subroutine question
by Limbic~Region (Chancellor) on Oct 04, 2004 at 19:22 UTC | |
by thor (Priest) on Oct 04, 2004 at 22:31 UTC | |
by Limbic~Region (Chancellor) on Oct 05, 2004 at 00:53 UTC |