> I have downloaded and installed your packaged RPM for the Pg.pm module for
> PostgreSQL 6.5.1 on RedHat 6.0 i386 linux and cannot be found by perl.
> Is my problem unique? When I run a perl script with 'use Pg;' in it I get:
> Can't locate Pg.pm in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at ../src/Perl/pg.pl line 1.
> BEGIN failed--compilation aborted at ../src/Perl/pg.pl line 1.
> The Pg.pm has been installed into:
> /usr/lib/perl5/site_perl

I haven't had the chance to use much perl in the last year or two, but
it may be that the default @INC does not include the directories we
used for the installation. Also, the RPMs were generated on a RH5.2
system, which may have a slightly different configuration.

On my RH5.2 system, I have the following INC paths:

> perl -e 'foreach $i (@INC) { printf "$i\n" }'
/usr/lib/perl5/i386-linux/5.00405
/usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux
/usr/lib/perl5/site_perl
.

And the RPM puts files in:

[root@golem i386]# rpm -qlp postgresql-perl-6.5.1-2.i386.rpm
/usr/lib/perl5/man/man3/Pg.3
/usr/lib/perl5/site_perl/Pg.pm
/usr/lib/perl5/site_perl/auto/Pg
/usr/lib/perl5/site_perl/auto/Pg/autosplit.ix
/usr/lib/perl5/site_perl/i386-linux/auto
/usr/lib/perl5/site_perl/i386-linux/auto/Pg
/usr/lib/perl5/site_perl/i386-linux/auto/Pg/Pg.bs
/usr/lib/perl5/site_perl/i386-linux/auto/Pg/Pg.so

which seems to be consistant. One thing you can try is to add
/usr/lib/perl5/site_perl to INC at the top of your program and see if
that helps. Try:

  unshift(@INC, "/usr/lib/perl5/site_perl");
  ...

One of the problems with generating RPMs is that unless you have more
than one machine you can't *really* test how they behave, but need
others to try them out. 

btw, it would probably be better to focus on new RPMs posted on
ftp://postgresql.org/pub/RPMS/ (and elsewhere), generated by Lamar
Owens who has taken over the RPM development and maintenance. These
include RPMs generated specifically for RH6.0, but Lamar had just put
out a request for someone to test the RH6.1-generated RPMs on a RH6.0
machine to see if they are compatible. If you have time, I'm sure he
would appreciate trying that out.

Good luck.

                    - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Wed, 20 Oct 1999 13:10:03 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: PostgreSQL Perl Module
Thomas Lockhart wrote:
> 
> > I have downloaded and installed your packaged RPM for the Pg.pm module for
> > PostgreSQL 6.5.1 on RedHat 6.0 i386 linux and cannot be found by perl.
> > Is my problem unique? When I run a perl script with 'use Pg;' in it I get:
> > Can't locate Pg.pm in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at ../src/Perl/pg.pl line 1.
> > BEGIN failed--compilation aborted at ../src/Perl/pg.pl line 1.
> > The Pg.pm has been installed into:
> > /usr/lib/perl5/site_perl
> 
> I haven't had the chance to use much perl in the last year or two, but
> it may be that the default @INC does not include the directories we
> used for the installation. Also, the RPMs were generated on a RH5.2
> system, which may have a slightly different configuration.
[snip]
> which seems to be consistant. One thing you can try is to add
> /usr/lib/perl5/site_perl to INC at the top of your program and see if
> that helps. Try:

Won't help.  RedHat 5.2's perl is much older than RedHat 6.0's, and
there are other major incompatibilities for compiled modules.  Not to
mention the directory differences in the install.  I recommend that
anyone who wants to use the RPM's with non-standard perl versions
rebuild from the source RPM, since the perl client is highly sensitive
to versioning problems.
 
> include RPMs generated specifically for RH6.0, but Lamar had just put
> out a request for someone to test the RH6.1-generated RPMs on a RH6.0
> machine to see if they are compatible. If you have time, I'm sure he
> would appreciate trying that out.

Yes, that would be NICE. The perl version is the same for 6.1 as for
6.0.

--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

Wed, 20 Oct 1999 15:21:06 -0400
Lamar Owen <lamar.owen@wgcr.org>
Re: PostgreSQL Perl Module