【发布时间】:2010-02-01 17:58:59
【问题描述】:
例子:
my $page = $args{'p'};
exit 1 if $page =~ /[^\d\w]/;
print "Content-Type: text/html\n\n";
print "<html><head></head><body>";
require "$page.pl";
somefunc();
print "</body></html>";
在输出开始后使用 require 有什么问题吗?或者所有 requires 都应该在脚本的顶部?
【问题讨论】:
-
没什么问题,除了使用
require "file";重用代码通常有什么问题。
标签: perl