Graph-Reader-OID
view release on metacpan or search on metacpan
my ($self, $graph, $fh) = @_;
while (my $line = <$fh>) {
chomp $line;
# End of vertexes section.
if ($line =~ m/^#/ms) {
next;
}
# Process OID.
my ($line_oid, $line_label) = split m/\s+/ms, $line, 2;
my @oid = split m/\./ms, $line_oid;
my $last_oid;
my $act_oid = $EMPTY_STR;
foreach my $oid (@oid) {
if ($act_oid ne $EMPTY_STR) {
$act_oid .= $DOT;
}
$act_oid .= $oid;
$graph->add_vertex($act_oid);
if ($act_oid eq $line_oid) {
if (! $line_label) {
( run in 0.873 second using v1.01-cache-2.11-cpan-71847e10f99 )