2009年6月18日星期四

[PerlChina] Re: 请教一个GRAPH::EASY模块的问题

addstar wrote:
> 我想做个无向图,但是以下代码运行后得到的总是一个有向图,已经折腾很久了,都不行,希望各位高手指教。
> #!/usr/bin/perl -w
> use strict;
> use Graph::Easy;
> my $graph = Graph::Easy->new(undirected =>'true');
> print "Graph is " . $graph->type() . "\n";

根据 new 文档:Takes optinal a hash reference with a list of options
我估计你需要 Graph::Easy->new( { undirected =>'true'} );

Qiang(James)

--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

没有评论: