Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!rex!ukma!usenet.ins.cwru.edu!ncoast!allbery From: allbery@NCoast.ORG (Brandon S. Allbery KF8NH) Newsgroups: comp.lang.perl Subject: Re: perl equivalent of "pg" or "more"? Message-ID: <1991May29.004958.2167@NCoast.ORG> Date: 29 May 91 00:49:58 GMT Article-I.D.: NCoast.1991May29.004958.2167 References: <1991May25.042644.2554@jpl-devvax.jpl.nasa.gov> Reply-To: allbery@ncoast.ORG (Brandon S. Allbery KF8NH) Followup-To: comp.lang.perl Organization: North Coast Public Access Un*x (ncoast) Lines: 24 As quoted from by system@syzzle.chi.il.us (awol): +--------------- | I am using MS-DOS. I had tried using read before, and did try sysread, | but everything requires pressing return. Then I can't just back up to | erase the prompt because I'm already on the next line. If it is not | possible to do this (get one keypress) on the dos version, it would be a | nice feature to add. Similiar to the Turbo-C getch function. +--------------- MS-DOS has an ioctl() function, and you can get character-at-a-time input by setting the console to RAW mode. If you have a DOS programming book of some kind (preferably assembler level, C books will generally assume access to functions that Perl can't get at) you can look up the values to pass to ioctl() to go into/out of RAW mode. Be warned that in RAW mode, you lose CTRL-BREAK and CTRL-PrtSc, so debug your program FULLY before adding the RAW mode ioctl's and make SURE it's reset before the Perl script exits! ++Brandon -- Me: Brandon S. Allbery KF8NH: DC to LIGHT! [44.70.4.88] Internet: allbery@NCoast.ORG Delphi: ALLBERY uunet!usenet.ins.cwru.edu!ncoast!allbery