Embperl:强大的嵌入式 Perl 工具助力 Web 开发
1. 快速入门
在开始使用 Embperl 之前,需要了解一些基本配置。在相关目录中,扩展名为.txt和.jpg的文件是普通文件,不需要 Embperl 处理,会直接提供。加载修改后的 Apache 配置文件,使用如下命令:
# /etc/init.d/httpd graceful现在,让我们通过一个简单的示例来展示如何使用 Embperl 显示 “hello, world!”。创建文件/var/www/html/embperl/index.html,内容如下(记得使用chmod a+r index.html命令设置文件权限):
[- $msg = 'hello, world!'; -] <html> <head> <title>hello, world with Embperl</title> </head> <body bgcolor="#ffffff"> [+ $msg +] </body> </html>要查看这个页面的结果,在浏览器中访问以下任意一个 URL:http://localhost/embperl/或www.opensource