Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Controlling already printed text to console.

by Athanasius (Chancellor)
on Aug 02, 2012 at 07:32 UTC ( #984963=note: print w/replies, xml ) Need Help??


in reply to Controlling already printed text to console.

The technique described by frozenwithjoy will work provided you haven’t moved the cursor to a new line. In addition to \r (carriage return), which moves the cursor to the start of the line, there is also \b (backspace), which moves the cursor back a single character.

For anything more complicated, you probably need a CPAN module, and you will likely have to get a module suitable for your OS:

  • For Windows there is Win32::Console.
  • For *nix you might investigate Curses (which won’t install on my Windows system).

HTH,

Athanasius <°(((><contra mundum

  • Comment on Re: Controlling already printed text to console.

Replies are listed 'Best First'.
Re^2: Controlling already printed text to console.
by humble (Acolyte) on Aug 03, 2012 at 19:06 UTC
    Oh, thnks for the "\b" addition - it is useful for my case.

    I do not need more complicated stuff. What have been said, enough for me!

    And it is Linux OS.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://984963]
help
Chatterbox?
[chacham]: experience is 8286. reminds me of our first computer
[Corion]: :D
[chacham]: first intel that is. my brother had a an apple ][e some time before that

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-03-22 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (276 votes). Check out past polls.