print $indent x $depth, substr( $str, 0, $pos1, '' );