Posts Tagged ‘Perl’

Apache支持perl在web的应用

apache支持perl在web的应用
1、安装apache
如apache安装在/usr/local/apache2/
2、安装perl
perl默认在linux系统里是自带的,
PS:要注意安装版本的差异,版本过低会报错
Can’t locate Apache/Response.pm in @INC …
Found this issue in Aurora SPARC Linux 2.0 (Fedora Core 3 for SPARC) when trying to install… turns out that after installing all the modules for rt, I still had an ancient verion of CGI.pm, which was not intended to correctly detect the mod_perl2 modules vs. regular mod_perl. Upgrading CGI [...]

Read the rest of this entry »

perl中==操作和eq操作有什么区别?

Binary “==” returns true if the left argument is numerically equal to the right argument.
Binary “eq” returns true if the left argument is stringwise equal to the right argument.
实际上也就是说==返回是是否数值相等,而eq返回的是字符相等。
$str1 = “1 -the first str”;
$str2 = “1 -the second str”;
print “numerically equal\n” if($str1 == $str2);
print “stringwise equal\n” if($str1 eq $str2);
结果只有numerically equal。
PS:perl会自动转换字符串。$str1 == $str2中的值都是1

Read the rest of this entry »