Graph:...r::XML(3pm)
π Graph::Reader::XML π
okay so bestie, welcome to Graph::Reader::XML, a perl class from the User Contributed Perl Documentation crew, and she is literally the moment. she reads directed graphs that are chilling in XML and hands you back a whole Graph object. no cap. π
β¨ NAME β¨
Graph::Reader::XML β class for reading a Graph instance from XML
π SYNOPSIS π
use Graph::Reader::XML;
use Graph;
$reader = Graph::Reader::XML->new();
$graph = $reader->read_graph('mygraph.xml');
like... that's it. that's the whole vibe. π¦
πΈ DESCRIPTION πΈ
so Graph::Reader::XML is a perl class that reads a directed graph stored as XML and gives you back an instance of the Graph class. it's giving "translator bestie" energy fr fr.
the XML format is designed to support the Graph classes β it can represent a single graph with a collection of nodes, and edges between those nodes. and here's the slay part: the graph, the nodes, and the edges can all have attributes specified. everyone gets accessories. π
β¨
also important: Graph::Reader::XML is a subclass of Graph::Reader, which is the one that defines the generic interface for Graph reader classes. so she's not doing her own thing, she's following the family blueprint. periodt.
π METHODS π
new()
constructor β generate a new reader instance. iconic behavior.
$reader = Graph::Reader::XML->new();
she does not take any arguments. don't come at her with arguments, she's not interested. π
read_graph()
read a graph from a file:
$graph = $reader->read_graph( $file );
the $file argument can be either a filename or a filehandle of a previously opened file. so like, whichever one you've got, she'll work with it. flexible queen. π
π KNOWN BUGS π
attribute values must be scalar. if they're not, well... you're on your own. π like genuinely, bestie, she said good luck and walked away. no further explanation, no safety net, nothing.
π«Ά SEE ALSO π«Ά
Graph::Readerβ the base class forGraph::Reader::XML. the parent, the blueprint, the origin story.Graph::Writer::XMLβ used to serialise aGraphinstance as XML. the other direction bestie!Graphβ Jarkko Hietaniemi's classes for representing directed graphs. the whole reason we're here.
β REPOSITORY β
<https://github.com/neilb/Graph-ReadWrite>
come hang out, the code lives there π
π AUTHOR π
Neil Bowers <neil@bowers.com>
π COPYRIGHT π
Copyright (c) 2001-2012, Neil Bowers. All rights reserved. Copyright (c) 2001, Canon Research Centre Europe. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie!! π this was perl v5.32.1, dated 2021-09-19, and it's Graph::Reader::XML(3pm) β go read some XML and make a graph, i'm obsessed with you, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraph-readwrite-perl 2.10-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms