[Kc] repeating \t TAB in print statement?

Frank Wiles frank at wiles.org
Thu Dec 14 12:29:29 PST 2006


On Thu, 14 Dec 2006 14:20:23 -0600
"Daryl Fallin" <darylvf at gmail.com> wrote:

> This is a totally newbie question, but I am doing a recursive
> subroutine and I would like to print  a tab (\t) for each recursion
> into the subroutine.
> 
> I thought something like print ("\t{$level} $rest $of $mydata");
> would work.

   You're looking for something like this: 

   print "\t" x $level . "$rest $of $mydata"; 

   The construct "x" tells print to repeat the previous part $level
   times. 

   Hope that helps. 

 ---------------------------------
   Frank Wiles <frank at wiles.org>
   http://www.wiles.org
 ---------------------------------



More information about the kc mailing list