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

Hello, Am using Perl in Ubuntu 22.10. In a terminal window I wish to print 1 line of plain text at a x,y location of my choosing. Am wanting to do this from within my Perl script. My version of Perl - at a terminal window I type 'perl -v' and the result is: This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi (with 60 registered patches, see perl -V for more detail) Can someone please provide me with some guidance please. Thank you. Edwin
  • Comment on printing at a x,y position in a terminal window

Replies are listed 'Best First'.
Re: printing at a x,y position in a terminal window
by LanX (Saint) on Jan 09, 2023 at 00:18 UTC
    That's a feature of most terminal windows and not Perl specific, see ANSI escape codes for details.

    If you need better Perl support than printing the raw escape codes (or interpolating them via variables) have a look at modules like Term::ANSIScreen

    There are even more sophisticated modules out there, which allow you building a Textual (G)UI, like Curses.

    Cheers Rolf
    (addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
    Wikisyntax for the Monastery