In Fedora, Perl program cannot find Time::Piece library
- by Eric Leschinski
I have a Perl program named /usr/bin/octbatch running as a script on Fedora 17 Linux.
When I run this command:
/usr/bin/octbatch
I get the error:
Can't locate Time/Piece.pm 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/bin/octbatch line 6.
BEGIN failed--compilation aborted at /usr/bin/octbatch line 6.
Here is the relevant lines of the Perl script:
#!/usr/bin/perl -wT
$ENV{PATH} = "/bin:/usr/bin:/usr/local/bin";
use strict;
use POSIX qw(setsid :sys_wait_h);
use Time::Piece;
use Time::Local;
I have to install Piece.pm so perl can find it. I've already installed it with this command (using the defaults):
/usr/bin/perl -MCPAN -e install Time::Piece
I have the Piece.pm file in /home/el/perl5/lib/perl5/x86_64-linux-thread-multi/ however when I run the octbatch command I get the same error as above. Like it can't even find it.
Here is my PERL5LIB variable:
el@defiant ~/gnuoctbluehost/single_stock_analysis $ env | grep PERL5
PERL5LIB=/home/el/perl5/lib/perl5/x86_64-linux-thread-multi:/home/el/perl5/lib/perl5
And the Piece.pm is located under /home/el/perl5/lib/perl5/x86_64-linux-thread-multi
So my question is, Why is it not finding my Piece.pm file? And what are the ways I can get the @INC variable to include it. Or how do I make perl see it?