sorry for not giving a direct answer...as i think the design is a kludge. Why would you store line.char references to text, when you could store these shapes in a hash and refer to any attribute directly. i.e. populate the hash as you're reading the Text widget.
if you really must (why) refer to text positionally, then perl's tk module has good facilities for this, as well as for generating graphics/widgets.