develooper Front page | perl.perl6.users | Postings from September 2017

What is P6 for P5 `use Term::ReadKey`?

Thread Next
From:
ToddAndMargo
Date:
September 9, 2017 06:41
Subject:
What is P6 for P5 `use Term::ReadKey`?
Message ID:
c829cb85-587f-feec-1080-862fef038036@zoho.com
Hi All!

I am trying to convert some Perl 5 code to Perl 6.

What do I use in place of
     use Term::ReadKey qw ( ReadKey ReadMode );

I am trying to convert the following:

<code>
use Term::ReadKey qw ( ReadKey ReadMode );

sub DumpKeyboard () {
    # Dump the contents of the keyboard buffer, if any
    my $Trash;

    ReadMode 4; # Turn off controls keys
    while  ( defined ( $Trash = ReadKey ( -1, \*STDIN ) ) ) {
       # print "\$Trash = $Trash\n";
    }
    ReadMode 1; # Reset tty mode before exiting
}

</code>


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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