cored has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks, i want to know how can i move the cursor on a perl script just like the gotoxy() function on C, i want to know too how to grab the keys from the keyboard, just point me to some modules that work in both environment win32 and POSIX i need a portable script for my project, and yes is a game :D

Replies are listed 'Best First'.
Re: Moving the cursor
by Mr. Muskrat (Canon) on Jun 11, 2003 at 21:55 UTC

    perlfaq8 says:

    How do I do fancy stuff with the keyboard/screen/mouse? How you access/control keyboards, screens, and pointing devices (``mic +e'') is system-dependent. Try the following modules: Keyboard Term::Cap Standard perl distribution Term::ReadKey CPAN Term::ReadLine::Gnu CPAN Term::ReadLine::Perl CPAN Term::Screen CPAN Screen Term::Cap Standard perl distribution Curses CPAN Term::ANSIColor CPAN Mouse Tk CPAN

Re: Moving the cursor
by robobunny (Friar) on Jun 12, 2003 at 04:21 UTC
    Curses is nice, and has the advantage of dealing with input, output and color all in one module. If your game needs to do a lot of screen updates, it will also help because it only draws screen positions that have changed when you update the screen. I've never used it under Windows, so I don't know how it works there. Hey, maybe you can even make use of my module :)