使用lib相对路径不起作用 [英] use lib relative path not working

查看:96
本文介绍了使用lib相对路径不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个perl脚本

#!/usr/bin/perl
use strict;
use lib 'lib';
use SOME_MOD;

可在我的旧服务器上使用. 在新服务器上,它仅适用于绝对路径,例如

that works on my old server. On the new server, it only works with absolute path, like

#!/usr/bin/perl
use strict;
use lib '/var/www/apps/myapp/lib';
use SOME_MOD;

我想念什么?

推荐答案

mod_perl的cwd与脚本位置不同. 当使用Perl CGI脚本支持配置Web服务器时,相对路径解析有效.

mod_perl's cwd is not the same as the scripts location. Relative path resolution works when Webserver is configured with Perl CGI Script Support.

这篇关于使用lib相对路径不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆