Do you have a question? Post it now! No Registration Necessary. Now with pictures!
March 23, 2012, 6:40 pm
rate this thread
Re: indent based on stack
( is the name of the subroutine, so 1, 2, and 3 above represent
A little experimentation shows that caller(N) returns a zero-length
list when N is larger than the number of layers of call. So you can
loop, calling "my @a = caller($i);" until scalar @a == 0.
The "x" operator, for A x B, returns a string being B copies of the
string value of A, so ' ' x $n returns a string of $n spaces.
Tim McDaniel, email@example.com