CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Problem with Log::Messages - Can't locate mylib.pl in @INC

 



ohaya
New User

Apr 11, 2018, 4:13 PM

Post #1 of 4 (5109 views)
Problem with Log::Messages - Can't locate mylib.pl in @INC Can't Post

Hi,

I am trying to use Log::Messages to add some logging to one of my programs (we can't use the Log4j module), but when I try to use it I am getting an error:

-bash-4.1$ perl logmessage1.pl
Can't locate mylib.pl in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/Module/Load.pm line 21, <GEN0> line 19.
BEGIN failed--compilation aborted at logmessage1.pl line 5.

That is with a simple program that does almost nothing:



Code
#!/usr/bin/perl 
use strict;
use warnings;

use Log::Message private => 0, config => './cf_file';


Code
 
The above was running Perl v5.10.1 on Redhat, but I also tried on Windows 10, with Perl v5.24.1 and got:


Code
e:\Ziptemp>perl logtest1.pl 
Can't locate mylib.pl in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib .) at C:/Perl64/lib/Module/Load.pm line 71, <GEN0> line 19.
BEGIN failed--compilation aborted at logtest1.pl line 5.

Code
 
I've searched the machine and I cannot find a "mylib.pl" anywhere.

Does anyone know how to get this working?

Thanks,
Jim


Zhris
Enthusiast

Apr 11, 2018, 4:44 PM

Post #2 of 4 (5106 views)
Re: [ohaya] Problem with Log::Messages - Can't locate mylib.pl in @INC [In reply to] Can't Post

Hi,


Quote
at /usr/share/perl5/Module/Load.pm line 21


Log::Message::Config uses Module::Load to load extra files extracted via the config include keyword. I suspect your ./cf_file config file is atleast partially the example provided in Log::Message::Config's synopsis, more specifically:


Code
# extra files to include 
# if none provided, no files are auto included
include = mylib.pl
include = ../my/other/lib.pl


Ensure you use an appropriate configuration to test i.e. remove the include lines.

Chris


(This post was edited by Zhris on Apr 11, 2018, 4:46 PM)


ohaya
New User

Apr 11, 2018, 4:53 PM

Post #3 of 4 (5098 views)
Re: [Zhris] Problem with Log::Messages - Can't locate mylib.pl in @INC [In reply to] Can't Post

Chris,

HAHA! BINGO!

That was it :)!

Thanks,
Jim


Zhris
Enthusiast

Apr 11, 2018, 4:54 PM

Post #4 of 4 (5095 views)
Re: [ohaya] Problem with Log::Messages - Can't locate mylib.pl in @INC [In reply to] Can't Post

You're welcome.

Have a nice day.

Chris

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives