无法定位String / Random.pm

时间:2014-03-11 13:43:02

标签: perl

大家好我在perl上有错误 当我运行它来浏览时,我得到了内部服务器错误 当在ubuntu命令行上运行它 再次出现错误......

Can't locate String/Random.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib
/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at CybOrg/Main.pm line 40.
BEGIN failed--compilation aborted at CybOrg/Main.pm line 40.
Compilation failed in require at login.pl line 26.
BEGIN failed--compilation aborted at login.pl line 26.

这是代码..

#!/usr/bin/perl
#
#    CybOrg - The Cybercafe Organizer
#    http://cyborg.sourceforge.net
#
#    Copyright (C) 2003 - The CybOrg Project
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License version 2 as 
#    published by the Free Software Foundation.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License along 
#    with this program; if not, write to the Free Software Foundation, Inc.,
#    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

use strict;
use warnings 'all';

use CybOrg::Main;
use CybOrg::Config;
use CybOrg::CGI;
use CybOrg::DB;

my $user_ok;
eval {
        $user_ok =  db_validate_user($params{'username'},$params{'password'});
};
if ($@) {
        $user_ok = '';
}

if ($user_ok) {
    my $session = send_cookie($params{'username'});
    eval {
        db_update_session($params{'username'}, $session);
    };
    if ($@) {
        redirect('cyborg.pl');
    } else {
        redirect('list.pl');
    }
} else {
    expire_cookie;
    redirect('cyborg.pl');
}

1;

我希望你能帮助我...... 感谢提前

2 个答案:

答案 0 :(得分:1)

最有可能的是,您需要安装String::Random

sudo cpan String::Random

通常cpan将自动安装依赖项,但这确实依赖于它们在模块元数据中声明(您正在安装的模块显然具有很长的历史记录,因此可能会遗漏一些依赖项) 。您可能会发现安装有效,但是还存在更多依赖性问题 - 只需一次安装一个。

答案 1 :(得分:0)

 perl -MCPAN -e 'install String::Random'

阅读本文以了解有关安装perl模块的更多信息: http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/