2011年10月18日星期二

Re: [PerlChina] Perl的web框架 - Mojolicious

已经接触了一段时间,欢迎交流

2011/10/18 truncatei <truncatei@gmail.com>:
> http://mojolicio.us/
>
> 终于有这样的框架出来了
>
> A next generation web framework for the Perl programming language.
> Back in the early days of the web, many people learned Perl because of
> a wonderful Perl library called CGI. It was simple enough to get
> started without knowing much about the language and powerful enough to
> keep you going, learning by doing was much fun. While most of the
> techniques used are outdated now, the idea behind it is not.
> Mojolicious is a new attempt at implementing this idea using state of
> the art technology.
>
> Features
> An amazing real-time web framework supporting a simplified single file
> mode through Mojolicious::Lite.
> Powerful out of the box with RESTful routes, plugins, Perl-ish
> templates, session management, signed cookies, testing framework,
> static file server, I18N, first class unicode support and much more
> for you to discover.
>
> Very clean, portable and Object Oriented pure Perl API without any
> hidden magic and no requirements besides Perl 5.10.1 (although 5.12+
> is recommended, and optional CPAN modules will be used to provide
> advanced functionality if they are installed).
> Full stack HTTP 1.1 and WebSocket client/server implementation with
> IPv6, TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart
> support.
> Built-in non-blocking I/O web server supporting libev and hot
> deployment, perfect for embedding.
> Automatic CGI and PSGI detection.
> JSON and HTML5/XML parser with CSS3 selector support.
> Fresh code based upon years of experience developing Catalyst.
>
> --
> 如果觉得无聊,您不妨访问Google Reader消遣 https://www.google.com/reader/view
> 要尝试黑版本Google,请访问 http://tinyurl.com/yk3yp7j
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>
>

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] Re: Perl的web框架 - Mojolicious

看了一下的,有点意思,而且至少得用Perl5.10以上版本才行,里面有个测试服务,据作者说的是
Try something like "ab -c 30 -n 100000 -k http://127.0.0.1:3000/" for
testing.
On a MacBook Pro 13" this results in about 20k req/s.
不过这个只是单纯的打印HTTP文件头而已

On 10月18日, 下午4时30分, truncatei <trunca...@gmail.com> wrote:
> http://mojolicio.us/
>
> 终于有这样的框架出来了
>
> A next generation web framework for the Perl programming language.
> Back in the early days of the web, many people learned Perl because of
> a wonderful Perl library called CGI. It was simple enough to get
> started without knowing much about the language and powerful enough to
> keep you going, learning by doing was much fun. While most of the
> techniques used are outdated now, the idea behind it is not.
> Mojolicious is a new attempt at implementing this idea using state of
> the art technology.
>
> Features
> An amazing real-time web framework supporting a simplified single file
> mode through Mojolicious::Lite.
> Powerful out of the box with RESTful routes, plugins, Perl-ish
> templates, session management, signed cookies, testing framework,
> static file server, I18N, first class unicode support and much more
> for you to discover.
>
> Very clean, portable and Object Oriented pure Perl API without any
> hidden magic and no requirements besides Perl 5.10.1 (although 5.12+
> is recommended, and optional CPAN modules will be used to provide
> advanced functionality if they are installed).
> Full stack HTTP 1.1 and WebSocket client/server implementation with
> IPv6, TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart
> support.
> Built-in non-blocking I/O web server supporting libev and hot
> deployment, perfect for embedding.
> Automatic CGI and PSGI detection.
> JSON and HTML5/XML parser with CSS3 selector support.
> Fresh code based upon years of experience developing Catalyst.
>
> --
> 如果觉得无聊,您不妨访问Google Reader消遣https://www.google.com/reader/view
> 要尝试黑版本Google,请访问http://tinyurl.com/yk3yp7j

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] Perl的web框架 - Mojolicious

http://mojolicio.us/

终于有这样的框架出来了

A next generation web framework for the Perl programming language.
Back in the early days of the web, many people learned Perl because of
a wonderful Perl library called CGI. It was simple enough to get
started without knowing much about the language and powerful enough to
keep you going, learning by doing was much fun. While most of the
techniques used are outdated now, the idea behind it is not.
Mojolicious is a new attempt at implementing this idea using state of
the art technology.

Features
An amazing real-time web framework supporting a simplified single file
mode through Mojolicious::Lite.
Powerful out of the box with RESTful routes, plugins, Perl-ish
templates, session management, signed cookies, testing framework,
static file server, I18N, first class unicode support and much more
for you to discover.

Very clean, portable and Object Oriented pure Perl API without any
hidden magic and no requirements besides Perl 5.10.1 (although 5.12+
is recommended, and optional CPAN modules will be used to provide
advanced functionality if they are installed).
Full stack HTTP 1.1 and WebSocket client/server implementation with
IPv6, TLS, Bonjour, IDNA, Comet (long polling), chunking and multipart
support.
Built-in non-blocking I/O web server supporting libev and hot
deployment, perfect for embedding.
Automatic CGI and PSGI detection.
JSON and HTML5/XML parser with CSS3 selector support.
Fresh code based upon years of experience developing Catalyst.

--
如果觉得无聊,您不妨访问Google Reader消遣 https://www.google.com/reader/view
要尝试黑版本Google,请访问 http://tinyurl.com/yk3yp7j

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

2011年10月17日星期一

回复: [PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值

只是通过LWP::UserAgent检查登录,没有用到Win32::GUI。
不过刚装好Win32::GUI(之前用cpan装不上,提示没有vc编译器)试了,这样会出现一个Console,然后过一会儿自己消失,隐藏效果不如PDK的好,但是可以用。
但是之前的问题很奇怪,不明白是啥原因。
 
 
------------------ 原始邮件 ------------------
发送时间: 2011年10月17日(星期一) 晚上11:00
收件人: "perlchina"<perlchina@googlegroups.com>;
主题: Re: [PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值
 
是 win32::GUI 的�目�?
可以��使用

my $hw = Win32::GUI::GetPerlWindow();
Win32::GUI::Hide($hw);
作 console �藏而不在 PDK 中�定


-------- Original Message --------
Subject: [PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值
From: leetom <leetom@qq.com>
To: perlchina <perlchina@googlegroups.com>
Date: 17/10/2011 17:54
> 在Win7下,使用PDK打包成exe,隐藏console,生成的exe如果直接双击运
> 行,`ipconfig` 就没有返回内容。如果在命令行下运行就正常。
> 使用`C:\\Windows\\system32\\ipconfig.exe` 绝对路径也不行。
> 如果不选择隐藏console选项,也正常,但是有个黑窗口让人很不爽。
> 这个是啥原因?在xp下正常。
>
>
> 先感谢回复~
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"
> 论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
> 要取消订阅此网上论坛,请发送电子邮件至
> perlchina+unsubscribe@googlegroups.com。
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN
> 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值

是 win32::GUI 的�目�?
可以��使用

my $hw = Win32::GUI::GetPerlWindow();
Win32::GUI::Hide($hw);
作 console �藏而不在 PDK 中�定


-------- Original Message --------
Subject: [PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值
From: leetom <leetom@qq.com>
To: perlchina <perlchina@googlegroups.com>
Date: 17/10/2011 17:54
> 在Win7下,使用PDK打包成exe,隐藏console,生成的exe如果直接双击运
> 行,`ipconfig` 就没有返回内容。如果在命令行下运行就正常。
> 使用`C:\\Windows\\system32\\ipconfig.exe` 绝对路径也不行。
> 如果不选择隐藏console选项,也正常,但是有个黑窗口让人很不爽。
> 这个是啥原因?在xp下正常。
>
>
> 先感谢回复~
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"
> 论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至
> perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN
> 访问此网上论坛。

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

[PerlChina] PDK打包的exe执行反引号内的命令之后没有返回值

在Win7下,使用PDK打包成exe,隐藏console,生成的exe如果直接双击运行,`ipconfig` 就没有返回内容。如果在命令行下运行就正常。
使用`C:\\Windows\\system32\\ipconfig.exe` 绝对路径也不行。
如果不选择隐藏console选项,也正常,但是有个黑窗口让人很不爽。
这个是啥原因?在xp下正常。


先感谢回复~

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

Re: [PerlChina] system 调用外部命令无法执行

一般都是环境变量PATH的问题
crontab或者cgi运行的时候,脚本和用户shell上的环境变量是不一样的

2011/10/17 Michael Zeng <galaxy2004@gmail.com>:
> system 命令正确执行是返回0的,否则是非0 ,
>
> 因此应该反过来写 :
> ! system( "XXXXcmd" ) or die "system error : $! "
>
>
> 2011/10/16 Yisong Zhen <zhenyisong@gmail.com>
>>
>> 找到原因了。
>> 谢谢Robin。
>> 我检查了httpd的error_log,上面显示是没发现我需要运行的程序-dialign。
>> 我估计还是环境变量没有设置好。
>> CGI在调用外部命令的时候没有调用apache运行用户的设置。这一点我不知道是否理解的对。
>> 所以我重新指定环境变量PATH和DIALIGN2_DIR(如果在本地执行,这些变量设置当然是对的,所以一开始并没有找到错误点!)
>>
>> 谢谢大家!
>>
>> 一松
>>
>> 2011/10/16 Robin Lee <robinlee.sysu@gmail.com>:
>> > 那就是没有错误。
>> > 你确定system里的命令没有被执行?
>> > 试一下 system("echo 'xxx'") ?
>> >
>> > 另外,应该判断 system 返回值是否为0来判断命令是否正确执行:
>> > system("xxx") == 0 or die;
>> > 而不是:
>> > system("xxx") or die;
>> >
>> > 另外,system的返回值并不是命令结束返回值,返回值是 ($? >> 8)。详见 perldoc -v '$?' 以及 perldoc -f
>> > system。
>> >
>> > 2011/10/15 Yisong Zhen <zhenyisong@gmail.com>:
>> >> 没有什么额外的信息,只是说程序的第9行:
>> >> die cannot excute the proram: at temp.pl line 9.
>> >>
>> >> 一松
>> >>
>> >> 2011/10/15 Robin Lee <robinlee.sysu@gmail.com>:
>> >>> 改用
>> >>> die "cannot excute the proram: $!"
>> >>> 看看有什么系统错误信息
>> >>>
>> >>> 2011/10/15 Yisong Zhen <zhenyisong@gmail.com>:
>> >>>> 诸位,一个小问题:
>> >>>>
>> >>>> 该脚本运行在Fedora15上面:但是无法执行system里面的程序。但是,程序不用借助perl外部调用可以正确执行。
>> >>>> 即,我直接在linux命令行敲入:dialign2-2 -fn promoter.out -n promoter.seq
>> >>>> 可以执行程序。
>> >>>>
>> >>>> 起初我觉得是路径不对,我输出了路径,发现是正确的,而且所需的DIALIGN2_DIR变量也设置正确。
>> >>>> 代码如下:
>> >>>>
>> >>>> #!/usr/bin/perl
>> >>>>
>> >>>> #my $dir = $ENV{'DIALIGN2_DIR'};
>> >>>> #my $path = $ENV{'PATH'};
>> >>>>
>> >>>>
>> >>>> my $commandLine = "dialign2-2 -fn promoter.out -n
>> >>>> promoter.seq";
>> >>>> my $returnValue = system($commandLine) || die "cannot excute
>> >>>> the proram";
>> >>>>
>> >>>> 非常感谢能有人出手帮助。
>> >>>>
>> >>>> 甄一松
>> >>
>> >> --
>>
>> --
>> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
>> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
>> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
>> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>>
>
>
>
> --
> Yours Sincerely
> Zeng Hong
>
> --
> 您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
> 要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
> 要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
> 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
>

--
如果觉得无聊,您不妨访问Google Reader消遣 https://www.google.com/reader/view
要尝试黑版本Google,请访问 http://tinyurl.com/yk3yp7j

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。

2011年10月16日星期日

Re: [PerlChina] system 调用外部命令无法执行

system 命令正确执行是返回0的,否则是非0 ,
 
因此应该反过来写 :
! system( "XXXXcmd" )  or die "system error :  $! "

 
2011/10/16 Yisong Zhen <zhenyisong@gmail.com>
找到原因了。
谢谢Robin。
我检查了httpd的error_log,上面显示是没发现我需要运行的程序-dialign。
我估计还是环境变量没有设置好。
CGI在调用外部命令的时候没有调用apache运行用户的设置。这一点我不知道是否理解的对。
所以我重新指定环境变量PATH和DIALIGN2_DIR(如果在本地执行,这些变量设置当然是对的,所以一开始并没有找到错误点!)

谢谢大家!

一松

2011/10/16 Robin Lee <robinlee.sysu@gmail.com>:
> 那就是没有错误。
> 你确定system里的命令没有被执行?
> 试一下 system("echo 'xxx'") ?
>
> 另外,应该判断 system 返回值是否为0来判断命令是否正确执行:
> system("xxx") == 0 or die;
> 而不是:
> system("xxx") or die;
>
> 另外,system的返回值并不是命令结束返回值,返回值是 ($? >> 8)。详见 perldoc -v '$?' 以及 perldoc -f system。
>
> 2011/10/15 Yisong Zhen <zhenyisong@gmail.com>:
>> 没有什么额外的信息,只是说程序的第9行:
>> die cannot excute the proram:  at temp.pl line 9.
>>
>> 一松
>>
>> 2011/10/15 Robin Lee <robinlee.sysu@gmail.com>:
>>> 改用
>>> die "cannot excute the proram: $!"
>>> 看看有什么系统错误信息
>>>
>>> 2011/10/15 Yisong Zhen <zhenyisong@gmail.com>:
>>>> 诸位,一个小问题:
>>>>
>>>> 该脚本运行在Fedora15上面:但是无法执行system里面的程序。但是,程序不用借助perl外部调用可以正确执行。
>>>> 即,我直接在linux命令行敲入:dialign2-2 -fn promoter.out -n promoter.seq
>>>> 可以执行程序。
>>>>
>>>> 起初我觉得是路径不对,我输出了路径,发现是正确的,而且所需的DIALIGN2_DIR变量也设置正确。
>>>> 代码如下:
>>>>
>>>> #!/usr/bin/perl
>>>>
>>>> #my $dir = $ENV{'DIALIGN2_DIR'};
>>>> #my $path = $ENV{'PATH'};
>>>>
>>>>
>>>> my $commandLine       = "dialign2-2 -fn promoter.out -n promoter.seq";
>>>> my $returnValue       = system($commandLine) || die "cannot excute the proram";
>>>>
>>>> 非常感谢能有人出手帮助。
>>>>
>>>> 甄一松
>>
>> --

--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。




--
            Yours Sincerely
                    Zeng Hong

--
您收到此邮件是因为您订阅了 Google 网上论坛的"PerlChina Mongers 讨论组"论坛。
要向此网上论坛发帖,请发送电子邮件至 perlchina@googlegroups.com。
要取消订阅此网上论坛,请发送电子邮件至 perlchina+unsubscribe@googlegroups.com。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。