Operating System - HP-UX
1834913 Members
3195 Online
110071 Solutions
New Discussion

Re: Error while using DBI in Perl

 
network_4
Advisor

Error while using DBI in Perl

Hi, I have HP-UX 11.11 server on which perl 5.8 version is running. i want to connect to database by using perl and for that when i am using "use DBI" its giving me below error:
--------------Error Message------------------------

Can't load '/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl' for module DBI: Exec format error at /opt/perl/lib/5.8.0/PA-RISC1.1-thread-multi/DynaLoader.pm line 229.
at /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/DBI.pm line 258
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/DBI.pm line 258.
Compilation failed in require at test.pl line 3.
BEGIN failed--compilation aborted at test.pl line 3.

--------------------------------------------------------------

please let me know the reason behind this. With perldoc i found that DBI module is there but still its not able to load it.
9 REPLIES 9
Dennis Handly
Acclaimed Contributor

Re: Error while using DBI in Perl

Can't load '/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl' for module DBI: Exec format error at

What does file(1) say about that shared lib?
Typically this error could mean it isn't for PA, or the shared lib versioning is all goofy.
Peter Godron
Honored Contributor

Re: Error while using DBI in Perl

Hi,
check that:
1. /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl exists and the permissions are correct (755)
2. chatr /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl

3. Your point allocation policy
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions. You have only rewarded ONE of 21 answers !

H.Merijn Brand (procura
Honored Contributor

Re: Error while using DBI in Perl

Ouch. perl-5.8.0 is very old.
Current is 5.8.8 which has *MANY* errors fixed.

Furthermore, you are using a threaded 32bit perl that was built for pa-risc-1.1, hardly the best choice for HP-UX 11.11

I'm assuming you are using perl with DBI to connect to a database, most likely Oracle, as that is where most problems lure.
If you are running Oracle 64bit, the perl you are using is useless, as 32bit perl cannot connect to 64bit Oracle. Moreover, if you are using perl-5.8.0 for 64bit, you do have to seriously think again. Amongst the many bugfixes in the early stage of perl-5.8.x, most of these were 64bit related.

If however, you are using perl in a 32bit environment, I'd like to see the output of 'perl -V', and the output of 'chatr /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl' and 'ldd /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl'

But again, I don't think DBI is causing the trouble. You can prove that with

# perl -MDBI -le 'print $DBI::VERSION'

If that succeeds, DBI is NOT the cause of failure. BTW, also DBI has had some evolution since the time 5.8.0 was released. DBI's version today is 1.54

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
network_4
Advisor

Re: Error while using DBI in Perl

Output of this command is

perl -MDBI -le 'print $DBI::VERSION'

Can't load '/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl' for module DBI: Exec format error at /opt/perl/lib/5.8.0/PA-RISC1.1-thread-multi/DynaLoader.pm line 229.
at /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/DBI.pm line 258
BEGIN failed--compilation aborted at /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/DBI.pm line 258.
Compilation failed in require.
BEGIN failed--compilation aborted.

What to do next
network_4
Advisor

Re: Error while using DBI in Perl

Output of "chatr"

+++++++++++++++++++++++++++++++++++++++
chatr /opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl
/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl:
64-bit ELF shared library
shared library dynamic path search:
LD_LIBRARY_PATH enabled first
SHLIB_PATH enabled second
embedded path enabled third
shared library mapped private disabled
shared vtable support disabled
explicit unloading enabled
linkage table protection disabled
segments:
index type address flags size
2 text 4000000000001000 ----c- D (default)
3 data 8000000000001000 ------ D (default)
static branch prediction disabled
kernel assisted branch prediction enabled
lazy swap allocation for dynamic segments disabled
nulptr references enabled

+++++++++++++++++++++++++++++++++++++++++++++


output of perl -v

+++++++++++++++++++++++++++++++++++++++++++=

This is perl, v5.8.0 built for PA-RISC1.1-thread-multi
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2002, Larry Wall

Binary build 806 provided by ActiveState Corp. http://www.ActiveState.com
Built 21:44:05 May 2 2003


Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dennis Handly
Acclaimed Contributor

Re: Error while using DBI in Perl

>Output of "chatr"
/opt/perl/lib/site_perl/5.8.0/PA-RISC1.1-thread-multi/auto/DBI/DBI.sl:
64-bit ELF shared library

Immediately remove this file. Or move it to a directory that is PA-RISC2.0W...

You have a 64 bit lib in a 32 lib path.
H.Merijn Brand (procura
Honored Contributor

Re: Error while using DBI in Perl

Your perl is 32bit, your DBI is 64bit. They don't match.
Will not work. Period.

Upgrade to a newer 64bit perl is you intend to use a 64bit DB environment.

/me wonders how 64bit DBI.sl ended up in a 32bit perl tree

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
network_4
Advisor

Re: Error while using DBI in Perl

any idea from where i will get 64 bit perl.
HP-UX B.11.11 U 9000/800 , oracle 9.2 (64 bit)
H.Merijn Brand (procura
Honored Contributor

Re: Error while using DBI in Perl

Several options:

* HP/ActiveState (the build you get on CD/DVD). Currently 5.8.7. Threaded.
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL

* HP Porting Center. Currently 5.8.8.
http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.8/

* My HP ITRC site pages, currently 5.8.8 (older versions still available):
http://mirrors.develooper.com/hpux/


BTW, I agree with Peter that you should improve on your point assignment ratio


Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn