View Full Version : @INC Error
autek
06-13-2006, 06:44 AM
I need to know how to correct this error in Perl. I Googled, but the solutions seemed overly envovled and beyond my Linux knowledge. Any one care to help. Thanks
Ed
jpaulb
06-13-2006, 11:25 AM
what warning are you getting?
autek
06-13-2006, 03:32 PM
This is the error when I try to start a ham radio app.
Can't locate rules.pm in @INC (@INC contains: /usr/share/xtlf/scoring /usr/share/xtlf /home/ed/.xtlf /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/xtlf/scoring/printcqzones.pm line 26.
BEGIN failed--compilation aborted at /usr/share/xtlf/scoring/printcqzones.pm line 26.
Compilation failed in require at /usr/share/xtlf/xtlf.pl line 55.
BEGIN failed--compilation aborted at /usr/share/xtlf/xtlf.pl line 55.
Any ideas/help ?? Thanks
Ed
jpaulb
06-13-2006, 04:57 PM
This is the error when I try to start a ham radio app.
Can't locate rules.pm in @INC (@INC contains: /usr/share/xtlf/scoring /usr/share/xtlf /home/ed/.xtlf /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/xtlf/scoring/printcqzones.pm line 26.
BEGIN failed--compilation aborted at /usr/share/xtlf/scoring/printcqzones.pm line 26.
Compilation failed in require at /usr/share/xtlf/xtlf.pl line 55.
BEGIN failed--compilation aborted at /usr/share/xtlf/xtlf.pl line 55.
Any ideas/help ?? Thanks
Ed
I am not a perl programer, its like computer yiddisch to me, do a little PHP
I assume these files exist.
Do you have any variables that should be set like $HTTP_SERVER_VARS[ ] document_root etc. that tells your app there to start from?
I am also not a Perl programmer, though I can probably read most anything (not the same as being able to write in a language).
But I'm not sure even an experienced Perl programmer could help you without seeing the source being compiled. Here you have error messages referring to what is at certain lines (26 and 55) in certain files. Well -- what is at line 26 and line 55?
tom_servo
06-14-2006, 08:02 PM
The program you are trying to run depends on a Perl module (collection of code that can be used in another Perl program, like a library) called rules. The @INC array variable tells Perl what directories on your machine contain modules. The rules.pm file does not exist in any of those directories as it should.
Rules.pm isn't on my system, and doesn't appear to be a common Perl module. A search of Debian packages showed one with a rules.pm, but it is in the wrong directory, so I think it is just coincidence, and not the module you need. There is some chance that this module came with the program you are trying to run, but it got installed to the wrong directory. You might try searching for a rules.pm that came with this app, and moving, or linking to one of those directories.
Alain
autek
06-15-2006, 06:57 AM
Alain, the rules.pm exist in the application I am trying to run. The app was installed with a ./install.sh script. Also you are correct that rules.pm is not a common Perl module.
>There is some chance that this module came with the program you are >trying to run, but it got installed to the wrong directory. You might try >searching for a rules.pm that came with this app, and moving, or linking >to one of those directories
That is my question, exactly how do I do this. I googled for an answer, but the answers where beyond the scope of my Linux knowlwedge. The app is being called from /usr/bin, so I assume this is where I need to link to the directories listed in @INC ?? I also assume the install.sh script needs to be corrected and do the necessary linking at the time it is run ?
Thanks
Ed
tom_servo
06-15-2006, 07:13 AM
Try changing to the directory with rules.pm in it with cd. Then create a link to that file. Here are two commands that should work, but only one needs to be done. If you want the program to work for other users of the system try this one: ln -s rules.pm /usr/local/lib/perl/5.8.7/
If you only care to have it work for you, try: ln -s rules.pm /home/ed/.xtlf/
This will create a link in the specified directory that will help Perl find the module it is having trouble locating. Another option since "." is in the @INC is to change to the directory containing rules.pm, then start the program. I don't think you'll want to do that all the time, but if your only going to run the program once or twice, that would be an easy way around (I think, but I have never actually tried including a module from '.', so cannot be sure).
Alain
autek
06-15-2006, 12:23 PM
Alain, thanks I'll give a try after I get home from work. I didn't know the standard ln command was the right way to link in Perl.
Thanks
Ed
autek
06-16-2006, 06:54 AM
Just a follow-up, closing note. This is Beta software and the problem is in the fact that the /.xtlf folder is not being created. It uses a ./install.sh script and needs re-written to create the missing folder. Thanks for all the help and ideas.
Ed
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.