tobold.org

correct • elegant • free

△ comp.lang.perl △

◅ How to Redirect STDOUT?

Arguments to tie() ▻

A "getc()" problem

In article <3120F109.7FE8@ummed.edu>,
Sam Ganesan  <Sam.Ganesan@ummed.edu> wrote:
>I am using a Sun running Solaris 2.4.  [...]
>system ("stty cbreak");

On my Solaris 2.4 system, this says

    unknown mode: cbreak

and, as you might expect, doesn't produce any output till I hit <enter>.

I can produce the effect you are looking for with

    system 'stty -icanon min 1 time 0'; # Wait for ever for 1 character.
    ...
    system 'stty icanon';

See termio(7) for the gory details.  I believe this is POSIXly
correct, so is probably reasonably portable.

But why not let somebody else do the hard work?  From the module
list...

Term::
::ReadKey      rdcf  Read keystrokes and change terminal modes    KJALB

(Tim: I believe that should read `Rdcf'.)

Tim.
--
Tim Goodwin   | "I just noticed that a SUN SLC takes longer to
UUnet PIPEX   | get to its boot prompt than it takes to build
Cambridge, UK | its [ Plan 9 ] kernel." -- Phil Winterbottom

Original headers:

From: tim@pipex.net (Tim Goodwin)
Newsgroups: comp.lang.perl.misc
Subject: Re: A "getc()" problem
Date: 14 Feb 1996 17:52:07 GMT
Organization: Unipalm PIPEX
Message-ID: <4ft7g7$hep@wave.news.pipex.net>
References: <3120F109.7FE8@ummed.edu>

△ comp.lang.perl △

◅ How to Redirect STDOUT?

Arguments to tie() ▻