Maybe this helps:
print "number of vertices: ".$G->vertices."\n";
print "number of edges: ".$G->edges."\n";
print "vertices: ".join (':',$G->vertices)."\n";
print "edges: ".join (':',$G->edges)."\n";
# set attribute name to "A" for edge E1 -> E2
$G->set_attribute("name","E1","E2","A") or die "error setting attribut
+e to edge: $!\n";
print "Name of edge E1->E2 is ".$G->get_attribute("name","E1","E2")."\
+n";
print "Name of edge E2->E3 is ".
(defined $G->get_attribute("name","E2","E3") ? $G->get_attribute
+("name","E2","E3") : "<undef>") ."\n";
update: I think you missread the docs concerning
has_vertices:
@V = $G->vertices
In list context returns the vertices @V of the graph $G.
In scalar context returns the number of the vertices.
$G->has_vertices(@v)
In list context returns a list which contains the vertex
of the vertices @v if the vertex exists in the graph $G
and undef if it doesn't. In scalar context returns the
number of the existing vertices.
----
amphiplex