LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2006, 03:08 PM   #1
Harry Seldon
Member
 
Registered: Feb 2004
Distribution: SLES 9
Posts: 112

Rep: Reputation: 15
perl - Can't locate Date/Calc.pm


When I try to execute a perl script, I'm getting the following error:

Can't locate Date/Calc.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at /usr/perl5/5.6.1/lib/BCBS.pm line 4.
BEGIN failed--compilation aborted at /usr/perl5/5.6.1/lib/BCBS.pm line 4.
Compilation failed in require at /apps/apache/cgi-bin/barcodes/cips/barcode.pl line 4.
BEGIN failed--compilation aborted at /apps/apache/cgi-bin/barcodes/cips/barcode.pl line 4.

I tried installing the module manually several times by compiling the Makefile.pl in the tar but kept getting this error. So I was fiddling around and found how to access cpan.org directly through perl using:

perl -MCPAN -e shell

and installing the Date::Calc mod from there.

cpan> install Date::Calc
Date::Calc is up to date.

I'm still getting the error, although now it's added the bit about BCBS.pm, which was previously the actual .pl code I was executing.

I have two versions of perl on the system I'm running, 5.00 and 5.61, but I've changed the path statement to look for 5.61 first in /usr/local/bin. The beginning of the file in the error message is:

package BCBS;
use Exporter;
use Time::localtime;
use Date::Calc qw(Add_Delta_Days);

$VERSION = 1.00;
@ISA = qw(Exporter);

Is there some noticeable snafu I'm missing here? Any help would guarantee idol worship for at least three continuous weeks, or twenty-one days total of piecemeal worshipping.
 
Old 04-05-2006, 10:51 PM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Where is your CPAN configured to install stuff?

Also, what does "locate Date/Calc.pm" return?
 
Old 04-06-2006, 09:44 AM   #3
Harry Seldon
Member
 
Registered: Feb 2004
Distribution: SLES 9
Posts: 112

Original Poster
Rep: Reputation: 15
I didn't change any of the defaults. I don't know if this helps but here is part of the config it runs at startup:

The next questions deal with Module::Build support.

A Build.PL is run by perl in a separate process. Likewise we run
'./Build' and './Build install' in separate processes. If you have any
parameters you want to pass to the calls, please specify them here.

Parameters for the 'perl Build.PL' command?
Typical frequently used settings:

--install_base /home/xxx # different installation directory

Your choice: []

Parameters for the './Build' command?
Setting might be:

--extra_linker_flags -L/usr/foo/lib # non-standard library location

Your choice: []

Do you want to use a different command for './Build install'?
Sudo users will probably prefer:

su root -c ./Build
or
sudo ./Build
or
/path1/to/sudo -u admin_account ./Build

or some such. Your choice: [./Build]

Parameters for the './Build install' command?
Typical frequently used setting:

--uninst 1 # uninstall conflicting files

Your choice: []

I can't find a specific file called Date/Calc.pm but a look for partials returned this:
# find / -name "Date*.pm"
# find / -name "*Calc*.pm"
/usr/local/lib/perl5/5.8.7/Math/BigInt/Calc.pm
/usr/local/lib/perl5/5.8.7/Math/BigInt/CalcEmu.pm
/usr/local/lib/perl5/site_perl/5.8.7/sun4-solaris/Date/Calc.pm
/export/home/user1/perl/Date-Calc-5.4/Calc.pm
/export/home/user1/perl/Date-Calc-5.4/blib/lib/Date/Calc.pm
/apps/apache/cgi-bin/Offsite/Date-Calc-4.3/Calc.pm
/apps/apache/cgi-bin/Offsite/Date-Calc-4.3/blib/lib/Date/Calc.pm
/apps/packages/Calc.pm
 
Old 04-06-2006, 01:12 PM   #4
Harry Seldon
Member
 
Registered: Feb 2004
Distribution: SLES 9
Posts: 112

Original Poster
Rep: Reputation: 15
I have another question in a similar vein; how can I permanently edit the @INC variable so that I can point it to what appears to be my main repository for modules?

/usr/local/lib/perl5/site_perl/5.8.7/

I know I can do this in each script using "use lib" but that could mean hundreds of changes with all the scripts I have.
 
Old 04-06-2006, 07:04 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
symlink /usr/bin/perl to /usr/bin/perl5.8.7 ?
 
Old 04-10-2006, 09:02 AM   #6
Harry Seldon
Member
 
Registered: Feb 2004
Distribution: SLES 9
Posts: 112

Original Poster
Rep: Reputation: 15
The symlink worked! Now at least I can go back to troubleshooting code instead of this perl install. Thanks, Chris.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pflogsumm can't locate Date/Calc.pm in @INC robadawb Linux - Software 1 01-23-2009 01:00 PM
locate/print text in perl on screen Jerry Draper Programming 2 01-10-2006 11:36 AM
perl problem- can't locate sys/sochet.ph oddo Linux - Software 1 02-07-2005 06:13 PM
Perl undefined subroutine /can't locate object method cobien Programming 1 11-17-2003 10:47 AM
perl and date manipulation Syncrm Programming 5 10-28-2002 02:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration