in reply to Easiest way to do something only on first iteration of loop

In this case, I don't know why you just don't print ' ' x $indentation before starting the loop? The first line will "start after the indentation". I don't see the need for a flag in this particular case. Your code is fine for a "do it once". In a more complex case perhaps you can "do it", then start the loop at element[1],i.e. for (@arr[1 .. $#arr]) {} Update: BTW testing a flag is a "fast operation" and normally of no concern.