Hello
I'm Looking for a scalar or a subroutine (or whatever),
that can tell me how many chars been printed
since the beginning of the current printed line in the terminal.
Does something like that exist, or do I must write it myself ?

Thx

Update:
Thanks for replaying everyone
It's not an XY problem, as it is (to me) an abstract problem.
(unless you refer to the flashing marker's XY co-ordinates ^^)
Although I agree it's a good guess, it is not for wrapping purposes.
I just need the column (x co-ordinate) of the marker.
In this specific case it's for a generalized-menu-printing function (specially designed for my format), which I'm working on,
but I found solving this problem necessary many times before for multiple applications (which I can't recall ^^).
So please think about it as a "how to get the marker's column" riddle/abstract problem,
rather than what possible uses can it have, and what alternatives can be used instead.

Thx again

In reply to scalar or sub that can tell me the terminal print offset ? by palkia

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.