Problem with PERL Informix strict refs
Posted in 2003
Topics: Installation, Setup & Upgrades, Licensing & Editions, Platform-Specific Issues, Versions, Editions & End-of-Life
Hi All, I have a probelm with PERL program, i know nothing about perl. We are upgrading Operating system from HP-UX 10.20 to HP-UX 11.11 (64bit) and Informix from IDS 7.3 to 9.3 FC... The probelm : We have a shell script calling a PERL program called check_table.pl, When i try to run this script i am getting the following problem. some_varible=Can't use string ("Informix") as a HASH ref while "strict refs" in use at /opt/perl 5/lib/site_perl/5.8.0/PA-RISC2.0-LP64/DBD/Informix.pm line 146$ + exit_stat=255 Can't use string ("Informix") as a HASH ref while "strict refs" in use at /opt/perl5/lib/ site_perl/5.8.0/PA-RISC2.0-LP64/DBD/Informix.pm line 146. != 0 ] Then i looked into the file Informix.pm I saw "Jonathan Leffler" name in that program. Here is the header part of the Informix.pm ( this is the upgrade version ) # @(#)$Id: Informix.pm,v 100.20 2002/11/18 23:24:41 jleffler Exp $ # # @(#)Informix Database Driver for Perl Version 1.04.PC1 (2002-11-21) # # Copyright 1994-95 Tim Bunce # Copyright 1996-99 Jonathan Leffler # Copyright 2000 Informix Software Inc # Copyright 2001-02 IBM # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. # #------------------------------------------------------------------------- # Code and explanations follow for IBM Informix Database Driver for Perl # (also known as DBD::Informix). #------------------------------------------------------------------------- and the older version header part is # @(#)Informix.PM 50.1 97/01/12 17:54:42 # # Portions Copyright (c) 1994,1995 Tim Bunce # Portions Copyright (c) 1996,1997 Jonathan Leffler # # $Derived-From: Informix.pm,v 1.18 1995/08/15 05:31:30 timbo Archaic $ # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. I will give more information if you need. Jonathan, i am expecting some suggestions from you. Any comments, suggestions are greatly appreciated. Thanks in advance Chavan Koya _________________________________________________________________ ICICI's NRI services. They make life easy. http://server1.msn.co.in/msnspecials/nriservices/index.asp Find out more.
Chavan Koya wrote: > I have a probelm with PERL program, i know nothing about perl. We > are upgrading Operating system from HP-UX 10.20 to HP-UX 11.11 (64bit) and > Informix from IDS 7.3 to 9.3 FC... > > The probelm : > We have a shell script calling a PERL program called > check_table.pl, When i try to run this script i am getting the following > problem. > > some_varible=Can't use string ("Informix") as a HASH ref while "strict refs" > in use at /opt/perl > 5/lib/site_perl/5.8.0/PA-RISC2.0-LP64/DBD/Informix.pm line 146$ > + exit_stat=255 > > Can't use string ("Informix") as a HASH ref while "strict refs" in use at > /opt/perl5/lib/ > site_perl/5.8.0/PA-RISC2.0-LP64/DBD/Informix.pm line 146. != 0 ] > > Then i looked into the file Informix.pm I saw "Jonathan Leffler" name > in that program. > > Here is the header part of the Informix.pm ( this is the upgrade version ) > > # @(#)$Id: Informix.pm,v 100.20 2002/11/18 23:24:41 jleffler Exp $ Why not DBD::Informix 2003.04? That has a newer version number. > # @(#)Informix Database Driver for Perl Version 1.04.PC1 (2002-11-21) >[...] > I will give more information if you need. > > Jonathan, i am expecting some suggestions from you. > > Any comments, suggestions are greatly appreciated. Thanks in advance Send code - it is impossible to debug your without it. And I mean the check_table code. Also, I need the versions of: Perl (ok - that's 5.8.0), DBI, DBD::Informix (ok - that's 1.04.PC1, but why not v2003.04), ESQL/C or CSDK - as noted in the documentation. Try: perldoc DBD::Informix. Also look at the BugReport script, and perldoc DBD::Informix::TechSupport. Did your script work previously? Under Perl 5.8.0? Unchanged? I wonder if you are using the archaic version of DBI->connect? $dbh = DBI->connect('dbase', 'user', 'pass', 'Informix'); The modern version is: $dbh = DBI->connect('dbi:Informix:dbase', 'user', 'pass', { RaiseError => 1}); That fourth argument is a hash reference - you might be passing 'Informix' as the value, in which case, a string will be used as a hash reference - hence the error you are seeing. Having thought of it, I'd be surprised if that is not your problem. perldoc DBI DBD::Informix -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/