Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.jpl.nasa.gov (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Perl keyboard processing Message-ID: <1991May23.044058.5068@jpl-devvax.jpl.nasa.gov> Date: 23 May 91 04:40:58 GMT References: <1357@unet.UUCP> <1991May18.211524.24055@convex.com> <1991May21.190550.27956@uunet.uu.net> <1991May21.200921.28300@convex.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 45 In article <1991May21.200921.28300@convex.com> tchrist@convex.COM (Tom Christiansen) writes: : From the keyboard of rbj@uunet.uu.net (Root Boy Jim): : :tchrist@convex.COM (Tom Christiansen) writes: : : : :>make sure not to use the same handle : :>for both in and out though. this idiom is open seen: : :> : :> open (TTYIN, " open (TTYOUT, ">/dev/tty") || die "Can't open /dev/tty" ; : : : :Why should different FH be used? : :Does the book discuss this anywhere? : : I don't know whether it's in the book. The problem is bidirectional : stdio buffers, I think. Basically, it just doesn't work easily unless : you have two filehandles; at leat, it didn't last time I checked. That's another thing that's already in patch 4. Perl will give you bidirectional stdio buffers on character special files as well as on sockets. Did I mention that you can now differentiate system file descriptors from private file descriptors? $^F is the maximum system file descriptor, ordinarily fd 2, standard error. System file descriptors are kept open on exec. On an open command, system file descriptors are preserved even if the open fails, and any subprocesses started by the open get the old descriptors rather than the new ones. : :>Using octal escapes is probably easiest. : : : :I stopped thinking in octal when I left the PDP-11 world. : :Hex is where it's at Tommy me boy! : : Not my fault you've been hexed. :-) : : :But wait! What about those new escape sequences: \e, and \c? That's \x and \c. : :I still want Larry to put in \m for metachars. : : Ick. You can still do it all in octal. :-) Why not just hold down the meta key? Larry