Indeed, 1st arg is index where to insert the text, 2nd is text, 3rd is tag, 4th is text 5th is tag - often used for text with non-trivial formatting...

here is an excerpt from tk docs:

pathName insert index chars ?tagList chars tagList ...? Inserts all of the chars arguments just before the character at index. + If index refers to the end of the text (the character after the last + newline) then the new text is inserted just before the last newline +instead. If there is a single chars argument and no tagList, then the + new text will receive any tags that are present on both the characte +r before and the character after the insertion point; if a tag is pre +sent on only one of these characters then it will not be applied to t +he new text. If tagList is specified then it consists of a list of ta +g names; the new characters will receive all of the tags in this list + and no others, regardless of the tags present around the insertion p +oint. If multiple chars-tagList argument pairs are present, they prod +uce the same effect as if a separate pathName insert widget command h +ad been issued for each pair, in order. The last tagList argument may + be omitted.

In reply to Re^2: weird problem inserting an array into a Tk text widget by vkon
in thread weird problem inserting an array into a Tk text widget by zentara

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.