in reply to Re^2: Modify a variable within curly braces (ASCII Sequence))
in thread Modify a variable within curly braces (ASCII Sequence))

BrowserUk's solution falls into the category of Stupid Interpolation Tricks in the context of the problem of the OP.

Your opinion noted and dismissed as irrelevant.

Personally, I'd do it this way: printf ("\033[4;%dHEnd Here $a\n", $a+=10 );, but that doesn't answer the OPs question.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^4: Modify a variable within curly braces (ASCII Sequence))
by westrock2000 (Beadle) on Jun 05, 2010 at 11:25 UTC
    Personally, I'd do it this way: printf ("\033[4;%dHEnd Here $a\n", $a+=10 );, but that doesn't answer the OPs question.

    Actually this helped tremendously! One of the side thoughts I had was how to increment the cursor placement from the reference just for that line without modifying the actual reference. The printf solution works perfect!
    \033[4;%dHEnd Here $a\n", $a+10 ); ### $a remains the same value, but this line is indented 10 spaces usi +ng $a as reference

      When I've done this sort of thing in the past, I've used a sub to generate the escape sequences:

      sub at{ sprintf "\e[%d;%dH", $_[0], $_[1] }.

      Then you can use something like print at( $_*2, $_ ), 'here' for 1..50;