Graph::Reader::OID - Perl class for reading a graph from OID format.
use Graph::Reader::OID; my $obj = Graph::Reader::OID->new; my $graph = $obj->read_graph($oid_file);
new()
Constructor. This doesn't take any arguments. Returns Graph::Reader::OID object.
read_graph($tgf_file)
Read a graph from the specified file. The argument can either be a filename, or a filehandle for a previously opened file. Returns Graph object.
File format with OID list. For OID (Object identifier) see L<Object identifier|https://en.wikipedia.org/wiki/Object_identifier> Example: 1.2.410.200047.11.2013.10234913023321120142141561581 Label #1 1.2.276.0.7230010.3.0.3.6.1 Label #2
# Pragmas. use strict; use warnings; # Modules. use Graph::Reader::OID; use IO::Barf qw(barf); use File::Temp qw(tempfile); # Example data. my $data = <<'END'; 1.2.410.200047.11.2013.10234913023321120142141561581 Label #1 1.2.276.0.7230010.3.0.3.6.1 Label #2 END # Temporary file. my (undef, $tempfile) = tempfile(); # Save data to temp file. barf($tempfile, $data); # Reader object. my $obj = Graph::Reader::OID->new; # Get graph from file. my $g = $obj->read_graph($tempfile); # Print to output. print $g."\n"; # Clean temporary file. unlink $tempfile; # Output: # 1-1.2,1.2-1.2.276,1.2-1.2.410,1.2.276-1.2.276.0,1.2.276.0-1.2.276.0.7230010,1.2.276.0.7230010-1.2.276.0.7230010.3,1.2.276.0.7230010.3-1.2.276.0.7230010.3.0,1.2.276.0.7230010.3.0-1.2.276.0.7230010.3.0.3,1.2.276.0.7230010.3.0.3-1.2.276.0.7230010.3.0.3.6,1.2.276.0.7230010.3.0.3.6-1.2.276.0.7230010.3.0.3.6.1,1.2.410-1.2.410.200047,1.2.410.200047-1.2.410.200047.11,1.2.410.200047.11-1.2.410.200047.11.2013,1.2.410.200047.11.2013-1.2.410.200047.11.2013.10234913023321120142141561581
Graph::Reader, Readonly.
base class for Graph file format readers
Install the Graph::Reader modules.
Install the Graph::Writer modules.
https://github.com/tupinek/Graph-Reader-OID
Michal Špaček mailto:skim@cpan.org
http://skim.cz
© 2014-2015 Michal Špaček BSD 2-Clause License
0.03
To install Graph::Reader::OID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graph::Reader::OID
CPAN shell
perl -MCPAN -e shell install Graph::Reader::OID
For more information on module installation, please visit the detailed CPAN module installation guide.