in reply to Re^2: Break foreach and print at specific position?
in thread Break foreach and print at specific position?

The simplest way is simply to add 28 spaces in front:
my $indent = " " x 28; say $indent,"your message";
I used a variable to save having to change x 28 however many places around the program when the indentation gets changed.

Replies are listed 'Best First'.
Re^4: Break foreach and print at specific position?
by perlmonks12 (Novice) on May 10, 2010 at 23:53 UTC
    I understand what you mean, but it's not what I'm looking, I want to align the output. For example, suppose print "\nValue1 is $data1 Value2 is $data2"; if it's inside a loop and the size of $data1 and $data2 changes often it will get all unaligned. I want to start at a pre-defined position in a way that output of value2 will always be printed on the same place, independent of the size of $data1. Thank you
Re^4: Break foreach and print at specific position?
by perlmonks12 (Novice) on May 11, 2010 at 01:02 UTC
    Great, it was exactly what I wanted. Thank you