Thanks. Your advice works perfectly, but I'm still confused. I don't see how, if the "new" happens before "has", the text gets into the object as shown by Data::Dumper. Maybe I shouldn't be worrying, but I'm scared there's a trap lying in wait for me.
Update: Thanks again. I won't pretend to understand everything at first glance late on a Friday evening, but it's a relief to know that there is a sound explanation. I will work through it, but I won't guarantee how many attempts it will take to get it into my skull. I knew there were aspects of Perl I didn't have a clue about, and this is clearly one that I need to understand better.