谁能告诉我为什么 firefox 没有打开并添加了以下 Net::HTTPServer 行?
#!/usr/bin/perl
# v5.10.1 / linux
use strict;
use warnings;
use Shell;
use Net::HTTPServer;
############ section ###############
my $server = new Net::HTTPServer(
port=>5000,
docroot=>"/home/frank/Perl/perl_info_pages",
log => "/home/frank/Perl/perl_info_pages/access.log",
chroot => 0, # - Run the server behind a virtual chroot().
# Since only root can actually call chroot,
# a URL munger is provided that will not
# allow URLs to go beyond the document root
# if this is specified.
# ( Default: 1 ) / true ???
# allow only for localhost... and user ***
# super server daemon control of??
# cgi...
);
$server->Start();
$server->Process();
############# end of section ###################
# can anyone tell me why these lines work(to open up firefox) with the above section commented out, but do not work when they are uncommented??
my $linkurl = 'http://localhost:5000';
firefox ("$linkurl");
最佳答案
正如在 HttpServer 文档中解释的那样,Process()
调用会阻塞并无限期地运行服务器,因此永远不会到达最后两行。
您可以做的最简单的事情是在 Start
和 Process
之间生成 Firefox 进程:套接字已经创建,当进程生成代码将已经返回服务器将开始运行。
关于linux - 火狐 ("$linkurl");问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7497524/