String(3)
π String(3) π
πΈ NAME πΈ
This String(3) page is the user-contributed Perl documentation for XML::Writer::String β and its whole job is literally capturing output from XML::Writer. That's it. That's the vibe. π
π¦ SYNOPSIS π¦
okay bestie, here's the exact code from the page β don't touch the punctuation, she's sensitive:
use XML::Writer;
use XML::Writer::String;
my $s = XML::Writer::String->new();
my $writer = new XML::Writer( OUTPUT => $s );
$writer->xmlDecl();
$writer->startTag('root');
$writer->endTag();
$writer->end();
print $s->value();
β¨ DESCRIPTION β¨
This module implements a bare-bones class specifically for the purpose of capturing data from the XML::Writer module. XML::Writer expects an IO::Handle object and writes XML data to the specified object (or STDOUT) via its print() method. This module simulates such an object for the specific purpose of providing the required print() method. π«Ά
It is recommended that $writer->end() is called prior to calling $s->value() to check for well-formedness. important little vibe check, bestie. β¨
π METHODS π
XML::Writer::String provides three methods β new(), print() and value():
$s = XML::Writer::String->new([list]);βnew()returns a newStringhandle. Fresh handle, new era. π$count = $s->print([list]);βprint()appends concatenated list data and returns the number of items in list. It's giving "collect the data, count the data." π$val = $s->value([list]);βvalue()returns the current content of the object as a scalar. It can also be used to initialize/overwrite the current content with concatenated list data. Iconic dual-purpose behaviour. β¨
π§ NOTES π§
This module is designed for the specific purpose of capturing the output of XML::Writer objects, as described in this document. It does not inherit from IO::Handle. For an alternative solution, look at IO::Scalar, IO::Lines, IO::String or Tie::Handle::Scalar. π¦
π AUTHOR π
Simon Oliver <simon.oliver@umist.ac.uk> π«Ά
π COPYRIGHT π
Copyright (C) 2002 Simon Oliver
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
XML::Writer, IO::Handle, IO::Scalar β go peek at these if you want the full lore. π
okay that's the whole page, bestie. this one's from perl v5.42.0, dated 2025-02-10, and it's the String(3) page β bye, slay, hydrate, and check your well-formedness. π
β¨π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-XML-Writer-String 0.100.0-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms