Subject: | |
From: | |
Reply To: | |
Date: | Tue, 14 Oct 1997 09:36:19 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Ted Ashton writes:
> Not sure how much help there is out there for me, but I figure it's worth
> a try. I'm wanting to read Scantron sheets and parse the results with perl.
> Most all of it works fine, except that the scantron machine spits out 310
> characters at blinding speed with no regard for anyone else's feelings. In MPE
> typically, this is no problem. Not so under the shell (and perl). There seems
> To be no way to do the equivalent of (for FILE SCANTRON=$STDINX;REC=-132):
...much FCONTROL()/FSETMODE() code deleted...
> Especially the FControl 41. Any Advice?
Since the POSIX GTI (General Terminal Interface) was never completed, you won't
be able to do this stuff from a 100% POSIX program.
I see two ways of doing it if you still want to use Perl:
1) Keep the raw I/O work in a Pascal NMPRG (judging from your source example).
The Pascal program reads each record, then writes it to stdout with a trailing
LF. On the Perl side, invoke the Pascal program via a pipe:
open(SCANTRON, "PASCPROG |");
while (<SCANTRON>) {
perform advanced formatting and processing
}
Note that you will need the newly GR-ed patch MPEJXM3A or the Pascal program
will abort when (re-)opening the pipe. (This patch does not fix input pipes
or socket descriptors; I have opened an HPRC call).
2) If you have your heart set on 100% Perl, write a small XS that implements
FCONTROL(), FDEVICECONTROL(), and FSETMODE() functions that will accept a Perl
filehandle and then call the MPE intrinsics. A must-have intrinsic XS is on
my Perl wish list, but since I'm detouring into the wonderful world of HPUX OS
updates, I just don't have the time to do it myself.
--
Mark Bixby E-mail: [log in to unmask]
Coast Community College Dist. Web: http://www.cccd.edu/~markb/
District Information Services 1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)
|
|
|