我非常喜欢面向个人项目的Fabric,但我在日常工作中处于面向Perl的环境中工作.我不想在工作流程中引入另一种语言,所以我想知道在Perl中是否存在类似于Fabric的自动部署.
是否有一个原因,为什么opendir没有同样的政策不是open在Perl的最佳实践?
我正在考虑至少这两项政策:
我真的很喜欢Template Toolkit,就像它如何与Catalyst一起工作,但我想要更多'web advanced'工具包.
对于像这样的Web对象,它可能只是一个*.tt文件包:Selector,Selector_DateTime,Menu,Data_Table ......
网络上有什么类似的东西吗?如果没有,为什么不呢?
此示例脚本:
#!/usr/bin/perl -w
while (1)
{
sleep(1);
}
Run Code Online (Sandbox Code Playgroud)
需要大约264 kB
grep -A1 heap /proc/9216/smaps
0817b000-081bd000 rw-p 0817b000 00:00 0 [heap]
Size: 264 kB
Run Code Online (Sandbox Code Playgroud)
但是当我只添加我的模块时:
#!/usr/bin/perl -w
use my_module;
while (1)
{
sleep(1);
}
Run Code Online (Sandbox Code Playgroud)
需要18092 kB!
grep -A1 heap /proc/9219maps
0817b000-09326000 rw-p 0817b000 00:00 0 [heap]
Size: 18092 kB
Run Code Online (Sandbox Code Playgroud)
注意:'my_module'有很多'use module;' 在里面.
我怎样才能找到需要这么多记忆的东西?
我怎样才能减少它?(使用'使用模块(功能)'?)
谢谢你的帮助.
我想对我的模块进行一些测试.
不幸的是,这些模块中的某些功能使用硬编码配置文件.
package My::Module;
use strict;
use warnings;
use Readonly;
Readonly my $CONF_FILE => '/my/conf_file.xml';
=head1 FUNCTIONS
=head2 Info($appli)
Returns Application Information
=cut
sub Info
{
my $appli = shift;
my $conf = MyXML::Read($CONF_FILE);
foreach my $a (ARRAY($conf->{application}))
{
return ($a) if ($a->{name} eq $appli);
}
return (undef);
}
[some others functions that use this config file...]
Run Code Online (Sandbox Code Playgroud)
我想到的解决方案是在每个模块中创建一个新函数,在我需要它时会更改这个默认配置文件.
然后我将在我的测试中使用该功能......
你有其他(更好的?)想法吗?
我在CentOS5.5上测试我的项目安装脚本.我的项目需要Date :: Manip模块,需要功能模块......
当我尝试通过CPAN 安装它(功能)时,CPAN想要安装Perl 5.9.5 ......
*** WHOA THERE!!! ***
This is an UNSTABLE DEVELOPMENT release.
The version of this perl5 distribution is 9, that is, odd,
(as opposed to even) and that signifies a development release.
If you want a maintenance release, you want an even-numbered version.
Do ***NOT*** install this into production use.
Data corruption and crashes are possible.
It is most seriously suggested that you do not continue any further …Run Code Online (Sandbox Code Playgroud)