Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't locate String/Random.pm

Tags:

perl

Hi guys I have a error on perl when i run it to browsert I got internal server error and when in run It on ubuntu command line there's a error again...

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.

This is the codes..

#!/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;

I hoped U will help me... THANKS IN ADVANCE

like image 458
user3367242 Avatar asked Oct 18 '25 23:10

user3367242


2 Answers

Most likely, you need to install String::Random:

sudo cpan String::Random

Usually cpan will auto-install dependencies, but that does rely on them being declared in module metadata (the module you are installing obviously has a long history, so it seems possible a few dependencies may have been missed). You may find the install works, but there are yet more dependency problems - simply install them one at a time.

like image 143
Neil Slater Avatar answered Oct 21 '25 15:10

Neil Slater


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

Read this to learn more about installing perl modules: http://www.thegeekstuff.com/2008/09/how-to-install-perl-modules-manually-and-using-cpan-command/

like image 33
m79lkm Avatar answered Oct 21 '25 14:10

m79lkm