Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: scalar or sub that can tell me the terminal print offset ?

by LanX (Bishop)
on Mar 17, 2012 at 19:34 UTC ( #960205=note: print w/replies, xml ) Need Help??


in reply to Re^2: scalar or sub that can tell me the terminal print offset ?
in thread scalar or sub that can tell me the terminal print offset ?

>but I find it hard to believe this doesn't already exists.

most probably this is just an xy problem. i.e. you are trying to solve a problem in a wrong way.

I slightly remember a BASIC dialect which had such a feature to allow positioning the cursor, but in Perl I never missed this.

IMHO in reality you'd rather prefer using

  • printf or
  • format or
  • templates with here-docs or
  • Term::ReadLine or
  • GUI-library like Tk

    (just some plausible guesses).

    If all of this is wrong and you don't wanna give us more insights, you can still try writing a routine out() to replace your prints, which automatically splits the arguments at newlines and counts the length of the last line in a global var $OUTPOS.

    Cheers Rolf

  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://960205]
    help
    Chatterbox?
    [holli]: so i filed a pull request for a open source project on github, they guy asks me "what motivates me to do this"
    [holli]: i am tempted to answer "to please our new asian overlords" or something
    [holli]: what a silly question

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (7)
    As of 2017-10-18 22:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My fridge is mostly full of:

















      Results (251 votes). Check out past polls.

      Notices?