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

I didn't think it would be that hard. Ensure Term::Screen was installed (which required that Term::Cap be installed). Do the simple commands, bidda boom, bidda bing, I have cursor positioning, clreol, all the rest that any language should provide in a plain old MS-DOS window. But noooo .. none of it works. TERM not set at C:/Perl/site/lib/Term/Screen.pm line 227 It stubbornly remains hooked to its Unix roots, and apparently has no way to run in an MS-DOS window under WinXP. Can't get Term::Cap to work either (although it's horrible, really). Guess Turbo Pascal spoiled me, lo those many decades ago. Gotoxy(5,5); print("Hello world.") Sigh ... Any suggestions on how to get Term::Screen to work in an MS-DOS window? I have ActiveState's perl installed: This is perl, v5.8.6 built for MSWin32-x86-multi-thread Toad

Replies are listed 'Best First'.
Re: WinXP Cursor Positioning
by BrowserUk (Patriarch) on Apr 19, 2005 at 21:10 UTC

    You need Win32::Console::ANSI.

    There is not, and never has been, any way to make the 32-bit cmd.exe console sessions honour ANSI escape sequences natively.

    There is a method of making the 16-bit command.com dos console emulator do so--by loading ansi.sys--but that suffers from having none of the commands, built-ins and extensions that make cmd.exe a usable command processor.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco.
    Rule 1 has a caveat! -- Who broke the cabal?
Re: WinXP Cursor Positioning
by jdporter (Paladin) on Apr 19, 2005 at 19:18 UTC
    Unless you figure out how to get a Windows console into ANSI mode (there is - or was - a way, IIRC), and then force Term::Screen to believe the terminal is ANSI, you're probably SOL. What I've done in the past to handle this is to switch between Term::Screen (or something like it) and Win32::Console, based on the current environment.