develooper Front page | perl.perl5.porters | Postings from October 2001

Re: [ID 20010929.014] Term::Complete screws up -ixon

Thread Previous | Thread Next
From:
Benjamin Goldberg
Date:
October 1, 2001 21:09
Subject:
Re: [ID 20010929.014] Term::Complete screws up -ixon
Message ID:
3BB93E79.72975764@earthlink.net
Sam Tregar wrote:
> 
> On Mon, 1 Oct 2001, Benjamin Goldberg wrote:
> 
> > It seems to me that instead of having code scatered throughout
> > Term:: and elsewhere which calls on the stty program, we should have
> > a pragma or module which encapsulates the functionality.  This one
> > module could be configured appropriately on a per-system basis, so
> > as to try really hard [at installation time, not at runtime], to get
> > it right.
> 
> You mean something like the existing IO::Stty perhaps?
> 
>    http://search.cpan.org/search?dist=IO-Stty

Hmm, yes precisely.

Though looking at how the program does what it does, I'd probably write
much of it differently ... like using hashes rather than seperate
variables for $c_cflag, $c_iflag, $ispeed, etc, using for loops instead
of ugly blocks like:
  $control_chars{'INTR'}=$termios->getcc(VINTR);
  $control_chars{'QUIT'}=$termios->getcc(VQUIT);
  $control_chars{'ERASE'}=$termios->getcc(VERASE);
  $control_chars{'KILL'}=$termios->getcc(VKILL);
  $control_chars{'EOF'}=$termios->getcc(VEOF);
  $control_chars{'TIME'}=$termios->getcc(VTIME);
  $control_chars{'MIN'}=$termios->getcc(VMIN);
  $control_chars{'START'}=$termios->getcc(VSTART);
  $control_chars{'STOP'}=$termios->getcc(VSTOP);
  $control_chars{'SUSP'}=$termios->getcc(VSUSP);
  $control_chars{'EOL'}=$termios->getcc(VEOL);
and other similar blocks.

-- 
"I think not," said Descartes, and promptly disappeared.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About