in reply to Retrieving meta information from txt

shows in a TK::Text Widget the portion of the text containing that word. This works fine.
If that is working, then you almost have what you want. Likely, the program now searches back up from the found word to where a line containing "<text>" to find the beginning of the section, and look further down to the next occurrence.

So hook into the first part: as it must have searched for the start, all you have to do is retrieve the contents:

my($meta) = substr($everything, $sectionstart) =~ /<text>(.*?)<\/text> +/;