Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re3: The difference between [system] and `backticks` and [qx//] (on win32)

by bbfu (Curate)
on Oct 11, 2003 at 18:36 UTC ( [id://298532]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: The difference between [system] and `backticks` and [qx//] (on win32)
in thread The difference between [system] and `backticks` and [qx//] (on win32)

I don't think it depends on whether the "escape sequence" is send from CMD.EXE, I think it has to do with what system or BIOS call the program printing uses to print. Back in my old DOS programming days, there were basically three ways to print to the screen: via the DOS interrupt call, via the BIOS interrupt call, or by directly writing the data to the screen memory buffer. And I think the only way to get special characters interpretted specially was to print via the DOS interrupt call. Obviously, this most likely doesn't accurately reflect the current reality, but I wouldn't be suprised if it's something similar. *shrug*

Also of note is the fact that, if you load ANSI.SYS in your CONFIG.SYS, then doing print "\e[2J" from perl should clear the screen. That depends, of course, on whether you can require that module be loaded or not.

If you can't require ANSI.SYS be loaded, you could also look in to the Win32::Console::ANSI module on CPAN, which appears to emulate the functionality and includes support for the clear-screen escape sequence. Update: Or, perhaps more directly, Win32::Console's Cls.

bbfu
Black flowers blossom
Fearless on my breath

  • Comment on Re3: The difference between [system] and `backticks` and [qx//] (on win32)
  • Download Code

Replies are listed 'Best First'.
Re: Re3: The difference between [system] and `backticks` and [qx//] (on win32)
by BrowserUk (Patriarch) on Oct 11, 2003 at 20:15 UTC

    Unfortunately, CMD.exe doesn;t support ANSI.sys. It only works in 16-bit command.com "compatibility box" sessions, which are pathetic.

    Using system 'cls'; works fine, but it just puzzles me why it bothers emitting chr(12), if nothing makes use of it. Still my best guess is that this is a remnent from teletype days that was intended to simulate clearing the screen when using a paper-teletype by throwing a new page.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    Hooray!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://298532]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found