2008年12月31日星期三

[PerlChina] Re: Fwd: 打印perl 套嵌hash问题

2008/12/31 yong <luo.yong.name@gmail.com>

perldoc Data::Dumper

YAML, YAML::Syck, JSON::Syck, JSON::XS 都可以,只不过输出不再是 Perl 了,而是 YAML 或者 JSON 格式的...呵呵.

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

-~----------~----~----~----~------~----~------~--~---

[PerlChina] Re: Question on module dependency_display

2008/12/31 Qiang (James) <shijialee@gmail.com>:
>> CPAN上做PM的Dependency Check和显示的工具叫什么?
>
> CPAN 打包模块常用的有 Module::Build 或 Module::Install(基于ExtUtils::
> MakeMaker). 每个打包工具可设定 Dependecy 的模块和版本.
>
> 另外 CPAN 也提供一个不错的在线查找模块 Dependency 工具
> http://deps.cpantesters.org/
>

根据 CPAN Dependencies 网页上的提示:

 "It relies on modules having META.yml files so it can work out their dependencies, and is case-sensitive."

所以对于 CPAN 模块而言,扫描它们自己的 META.yml 文件即可.而 META.yml 中的依赖项一般也是 CPAN 模块的作者自己手工列出的. 不过有趣的是 Jifty 有一个 .t 文件自己扫描实际使用的模块并将之与 Makefile.PL 中列出的进行比较:

http://search.cpan.org/src/SARTAK/Jifty-0.80408/t/01-dependencies.t

本质上是一种源码级别的正则扫描:

   # look for use and use base statements
   $used{$1}{$File::Find::name}++ while $data =~ /^\s*use\s+([\w:]+)/gm;
   while ($data =~ m|^\s*use base qw.([\w\s:]+)|gm) {
       $used{$_}{$File::Find::name}++ for split ' ', $1;
   }

因此不是 100% 可靠的东西,但能满足需要 ^_^ 这小片代码其实来自 CPAN 上的 Test::Dependencies::Light 模块( Jifty 为了减少一个依赖项就把代码内联了,呵呵,它原先确实是使用 Test::Dependencies 模块的).

真正运行时级别上的依赖项扫描, 可能当属 pp 工具使用的 Module::ScanDeps 模块了.呵呵. (Test::Dependencies::Heavy 模块会实际编译 Perl 代码.)

>> 打算利用元旦假期整理下很多PM的关系,并且Display出一张图.
>

我很有兴趣把你的代码整合到 UML::Class::Simple 中来,如果你愿意分享的话,呵呵.

> 感觉应该有人做过类似的工作, 可以找找.
>

Qiang 所言极是 ^_^

>> 谢谢, 祝各位新年快乐-工作顺利,身体健康!
>>

新年好!新年好!

Cheers,
-agentzh

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

-~----------~----~----~----~------~----~------~--~---

Re: [PerlChina] Question on module dependency_display

2008/12/31 Qiang (James) <shijialee@gmail.com>:
>> CPAN上做PM的Dependency Check和显示的工具叫什么?
>
> CPAN 打包模块常用的有 Module::Build 或 Module::Install(基于ExtUtils::
> MakeMaker). 每个打包工具可设定 Dependecy 的模块和版本.
>
> 另外 CPAN 也提供一个不错的在线查找模块 Dependency 工具
> http://deps.cpantesters.org/
>

根据 CPAN Dependencies 网页上的提示:

 "It relies on modules having META.yml files so it can work out their dependencies, and is case-sensitive."

所以对于 CPAN 模块而言,扫描它们自己的 META.yml 文件即可.而 META.yml 中的依赖项一般也是 CPAN 模块的作者自己手工列出的. 不过有趣的是 Jifty 有一个 .t 文件自己扫描实际使用的模块并将之与 Makefile.PL 中列出的进行比较:

http://search.cpan.org/src/SARTAK/Jifty-0.80408/t/01-dependencies.t

本质上是一种源码级别的正则扫描:

   # look for use and use base statements
   $used{$1}{$File::Find::name}++ while $data =~ /^\s*use\s+([\w:]+)/gm;
   while ($data =~ m|^\s*use base qw.([\w\s:]+)|gm) {
       $used{$_}{$File::Find::name}++ for split ' ', $1;
   }

因此不是 100% 可靠的东西,但能满足需要 ^_^ 这小片代码其实来自 CPAN 上的 Test::Dependencies::Light 模块( Jifty 为了减少一个依赖项就把代码内联了,呵呵,它原先确实是使用 Test::Dependencies 模块的).

真正运行时级别上的依赖项扫描, 可能当属 pp 工具使用的 Module::ScanDeps 模块了.呵呵. (Test::Dependencies::Heavy 模块会实际编译 Perl 代码.)

>> 打算利用元旦假期整理下很多PM的关系,并且Display出一张图.
>

我很有兴趣把你的代码整合到 UML::Class::Simple 中来,如果你愿意分享的话,呵呵.

> 感觉应该有人做过类似的工作, 可以找找.
>

Qiang 所言极是 ^_^

>> 谢谢, 祝各位新年快乐-工作顺利,身体健康!
>>

新年好!新年好!

Cheers,
-agentzh

[PerlChina] Re: Question on module dependency_display

2008/12/31 Fayland Lam <fayland@gmail.com>:
>
> maybe you want this.
> http://search.cpan.org/~marcel/GraphViz-ISA-0.01/ISA.pm
>

Oh, I didn't know there was a GraphViz::ISA. I've been working on
something (sort of) similar:

http://search.cpan.org/dist/UML-Class-Simple

But I'm afraid it's a bit OT. It only covers "use base" or even less.
The demand for general "use" dependency support in UML::Class::Simple
is rather common now :P

Thanks!
-agentzh

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

Re: [PerlChina] Question on module dependency_display

2008/12/31 Fayland Lam <fayland@gmail.com>:
>
> maybe you want this.
> http://search.cpan.org/~marcel/GraphViz-ISA-0.01/ISA.pm
>

Oh, I didn't know there was a GraphViz::ISA. I've been working on
something (sort of) similar:

http://search.cpan.org/dist/UML-Class-Simple

But I'm afraid it's a bit OT. It only covers "use base" or even less.
The demand for general "use" dependency support in UML::Class::Simple
is rather common now :P

Thanks!
-agentzh
_______________________________________________
China-pm mailing list
China-pm@pm.org
http://mail.pm.org/mailman/listinfo/china-pm

Re: [PerlChina] Question on module dependency_display

Qiang (James) wrote:
> 首先,邮件组已经搬到 Google Group, 请更新你的设定
> http://groups.google.com/group/perlchina?hl=zh-cn
>
> Max WU wrote:
>
>> 请问下,
>> CPAN上做PM的Dependency Check和显示的工具叫什么?
>>
>
> CPAN 打包模块常用的有 Module::Build 或 Module::Install(基于ExtUtils::
> MakeMaker). 每个打包工具可设定 Dependecy 的模块和版本.
>
> 另外 CPAN 也提供一个不错的在线查找模块 Dependency 工具
> http://deps.cpantesters.org/
>
>
>> 打算利用元旦假期整理下很多PM的关系,并且Display出一张图.
>>
>
> 感觉应该有人做过类似的工作, 可以找找.
>
>

maybe you want this.
http://search.cpan.org/~marcel/GraphViz-ISA-0.01/ISA.pm


>> 谢谢, 祝各位新年快乐-工作顺利,身体健康!
>>
>> --Max
>> ---------------------------------------
>> "Any problem in computer science can be solved with another level of
>> indirection"
>> -----said David Wheeler
>>
>
> Qiang(James)
>
> --~--~---------~--~----~------------~-------~--~----~
> 您收到此信息是由于您订阅了 Google 论坛"PerlChina 论坛"论坛。
> 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
> 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
> 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
> -~----------~----~----~----~------~----~------~--~---
>
>


--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/

_______________________________________________
China-pm mailing list
China-pm@pm.org
http://mail.pm.org/mailman/listinfo/china-pm

[PerlChina] Re: Question on module dependency_display

Qiang (James) wrote:
> 首先,邮件组已经搬到 Google Group, 请更新你的设定
> http://groups.google.com/group/perlchina?hl=zh-cn
>
> Max WU wrote:
>
>> 请问下,
>> CPAN上做PM的Dependency Check和显示的工具叫什么?
>>
>
> CPAN 打包模块常用的有 Module::Build 或 Module::Install(基于ExtUtils::
> MakeMaker). 每个打包工具可设定 Dependecy 的模块和版本.
>
> 另外 CPAN 也提供一个不错的在线查找模块 Dependency 工具
> http://deps.cpantesters.org/
>
>
>> 打算利用元旦假期整理下很多PM的关系,并且Display出一张图.
>>
>
> 感觉应该有人做过类似的工作, 可以找找.
>
>

maybe you want this.
http://search.cpan.org/~marcel/GraphViz-ISA-0.01/ISA.pm


>> 谢谢, 祝各位新年快乐-工作顺利,身体健康!
>>
>> --Max
>> ---------------------------------------
>> "Any problem in computer science can be solved with another level of
>> indirection"
>> -----said David Wheeler
>>
>
> Qiang(James)
>
> >
>


--
Fayland Lam // http://www.fayland.org/
Foorum based on Catalyst // http://www.foorumbbs.com/


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