in reply to Re^2: XML::Writer oddness
in thread XML::Writer oddness

\$doc is a reference to an XML::Writer::_String object instead of a reference to a scalar,

Well, it's both, seeing as $doc is a scalar. And furthermore, the contents of the scalar are obviously meant to be used as a string (If not, $doc would be given a reference.) So don't be afraid to use it as a string.

Replies are listed 'Best First'.
Re^4: XML::Writer oddness
by TedHopp (Novice) on Feb 25, 2010 at 02:48 UTC
    So don't be afraid to use it as a string.

    Heh. Well, doing just that is what led to the problem with gzip. :-)

      Magics collided. Happens. Using "$doc" instead of $doc you make a copy.
        Indeed it does. That leads me to wander off topic. I had tried $doc = "$doc";, which was close but does not work. Even this does not work:
        my $copy = $doc; undef *doc; $doc = $copy;
        After that, $doc is still a blessed object (although $copy isn't). From this, I conclude that I don't understand symbol tables. Why doesn't it work to undef everything about $doc? (For that matter, why isn't $copy a blessed object?) Is there a way to "unbless" $doc and to remove its object flag after it has been mucked with by XML::Writer?