[27842] in Perl-Users-Digest
Perl-Users Digest, Issue: 9206 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 14:06:01 2006
Date: Thu, 27 Apr 2006 11:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 27 Apr 2006 Volume: 10 Number: 9206
Today's topics:
Re: Term::ReadKey on Win? 5.005 vs 5.8.8? <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Apr 2006 17:57:06 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Term::ReadKey on Win? 5.005 vs 5.8.8?
Message-Id: <e2r0m6.fc.2@news.isolution.nl>
Ilya Zakharevich schreef:
> Dr.Ruud:
> | no-binmode | binmode
> ------------+------------------------------------------------+--------
---
> getc | eats 1st-\r, delays until the 4th-\r or non-\r | no
problem
> read(...,1) | delays until the 3rd-\r or non-\r | no
problem
> ------------+------------------------------------------------+--------
---
>
> I hope it is a correct summary...
I did "s/(\d(?:rd|st|th)) /$1-/" to emphasize that "non-\r" must be read
as "1st-non-\r".
I am not sure that it eats the 1st-\r; it eats one \r, but maybe not
exactly the 1st.
The summary is probably not OK with my last test, because the \r that
ends the delaying phase, does not dig up the two delayed \r's, while a
non-\r (at any moment) does.
| no-binmode | binmode
------------+-------------------------------------+---------
getc | eats \r, delays 2 \r's until non-\r | \r's OK
read(...,1) | delays 2 \r's until non-\r | \r's OK
------------+-------------------------------------+---------
>> read + binmode: the same as getc + binmode.
>
> Thanks, this is all complete and clear.
>
>> So this time, with the same source, I don't see the \r-bursts anymore
>> when only using the \r-key.
>
> Now it is all back to the beginning. I do not have a slightest idea
> WHAT you compare with WHAT here, and it annulates all the good stuff
> you wrote before...
"when only using the \r-key".
So the bursts didn't occur (in the latest test) when only using an
\r-key, and the two "delayed \r's" remained delayed until a non-\r-key
was hit.
I also reluctantly tried whether "$|=1" would make any difference, but
it didn't.
>> Two \r's are delayed until a non-\r key is
>> pressed. I have no good explanation for this changed behaviour. (I
>> have been playing with ioctl-settings before, so maybe the console
>> was in a different ioctl-mode then.)
>
> Should I understand it as the behaviour described before is happening
> in a freshly-created console, and doing some stty.exe calls may
> slightly improve the action?
I was just gessing (there), because I haven't found a way to get the
"\r-bursts with hitting just a \r-key", as it did before. With "burst" I
mean that the two delayed \r's are returned before the last hit key is
returned, so a happening of three quick getc-returns in a row.
> [I saw reports that calling stty.exe changes the console behaviour,
> even though stty.exe is CygWin, and the calling application is not.]
There is often a Cygwin ssh console window active as well, and that also
starts via cmd.exe (as the avast virusscanner nicely reports), so maybe
there is interference there. I'll try more tests with a fresh system.
That Cygwin has a "perl, v5.8.7 built for cygwin-thread-multi-64int"
that I didn't yet use for testing.
Heheh, great, I started "joe" in there to edit a Perl-source, and it
color codes the Perl syntax. I tried "pico -w", but this Cygwin doesn't
have many editors installed, and I have worked a lot (many years ago)
with Wordstar so those keys are still in my muscle's memory.
Is there a POSIX::termios for Win32?
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 9206
***************************************