[Israel.pm] Simple terminal manipulation

Offer Kaye offer.kaye at gmail.com
Thu Feb 2 05:01:11 PST 2006


On 2/2/06, Madani, Srikanth, VF-DE wrote:
>
> and then "delete" these two lines, and replace them with the output of
> another print statement:
>

One simple solution:
Use "clear", e.g.:
system("clear");

More complicated - use "Term::ANSIScreen", it has some functions that
look like they would be useful for you, see the :screen and :cursor
function sets.

>
> Counting the length of existing text, and "back-spacing" over it using
> \b works, but only for a single line.
>

[...snip...]

> and then keep replacing 1003 with the actual number of rows inserted
> etc.
>

So the "\b" solution would work for this case, right?
Just make sure to print empty spaces for shorter numbers, otherwise
you would for example replace 1003 with 504 and get "5043" :)

HTH,
--
Offer Kaye




More information about the Perl mailing list