2009年2月27日星期五

[PerlChina] Re: 包(.pm)的问题

2009/2/27 mark <zhusheng303@163.com>:
> 谢谢,只是我想,建包是想将我的自己编的函数归类。我发现$max=MK1::max($zhu,$mark);
> 传值就对啦,有没有别的解决办法?
>

use Exporter?

顺便提一下,List::Util 模块中有现成的 max 和 maxstr 函数 ;) 它那里也是使用 Exporter 来导出符号,从而调用时可以这么写:

use List::Util qw( max );
print max(5, 6);

Cheers,
-agentzh

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

没有评论: