Solaris 10을 사용하고 있습니다. 펄 프로그램.perl 프로그램을 실행할 수 없습니다 : Perl5.8.4를 사용하여 @INC에서 Time/Piece.pm을 찾을 수없고 perl을 사용하여 @INC에서 DBI.pm을 찾을 수 없음 5.12.3
가 나는 두 펄 버전을 설치 한 : 버전의
/usr/bin/perl
은 5.8.4
와 나는 DBI 패키지를 설치 한 5.12.3
버전의
/usr/local/bin/perl
/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/auto/DBI/.packlist
), 다른
perl
버전의 Perl 프로그램을 실행하면 얻을 수있는 문제는 (우분투에서는 잘 작동합니다.)
bash-3.00# perl temp.pl Can't locate Time/Piece.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/sun4- solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4- solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .) at temp.pl line 4. BEGIN failed--compilation aborted at temp.pl line 4. bash-3.00# /usr/local/bin/perl temp.pl Can't locate DBI.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.12.3 /sun4-solaris /usr/local/lib/perl5/site_perl/5.12.3 /usr/local/lib/perl5/5.12.3/sun4- solaris /usr/local/lib/perl5/5.12.3 /usr/local/lib/perl5/site_perl .) at temp.pl line5. BEGIN failed--compilation aborted at temp.pl line 5.
나는 많은 방법을 시도했지만 solaris에서 내 Perl 프로그램을 실행하는 방법을 얻지 못했습니다. 아무도 도와 드릴 수 있습니까?
다음은 제 프로그램입니다. 사실 그것은 @Borodin에 의해 재정의되었습니다. 그에게 고마워.
use strict;
use warnings;
use Time::Piece;
use DBI;
open my $log, '<', '/opt/testlogs/test.log' or die "Unable to open log file: $!";
my ($count_start, $count_interim, $count_stop) = (0, 0, 0);
while (<$log>) {
if (/server start/) {
$count_start++;
}
elsif (/server interim-update/) {
$count_interim++;
}
elsif (/server stop/) {
$count_stop++;
}
}
print <<END;
Start: $count_start
Interim: $count_interim
Stop: $count_stop
END
print localtime->strftime("%b %e %H:%M:%S"), "\n";
my $dbh = DBI->connect("DBI:Pg:dbname=postgres;host=localhost", "postgres", "postgres", { 'RaiseError' => 1 });
my $rows = $dbh->do(
"insert into radius (server_start, server_stop, server_interim)
Values ($count_start, $count_stop, $count_interim)"
);
printf "%d %s affected\n", $rows, $rows == 1 ? 'row' : 'rows';
(http://stackoverflow.com/questions/tagged/perl?sort=faq) [? 누락 된 펄 모듈을 설치하는 가장 쉬운 방법은 무엇 (HTTP : //stackoverflow.com/questions/65865/whats-the-easiest-way-to-install-a-missing-perl-module) – daxim