Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl program works on command line but fails as a CGI script

Status
Not open for further replies.

Amazator

Programmer
Mar 8, 2006
13
IN
Hi folks,

I've written a program that works fine on command-line but fails as a CGI script when invoked from a browser. Apache is the server. I've put the script in the cgi-bin/<myuserid> folder.

The error I get is:

Code:
[Fri Apr 7 03:32:04 2006] lib.pm:
[Fri Apr 7 03:32:04 2006] lib.pm:
[Fri Apr 7 03:32:04 2006] Config.pm:
[Fri Apr 7 03:32:04 2006] Config.pm: Perl lib version (5.00503) doesn't match executable version (5.00502) at /oracle/iAS/1.0.2.2/Apache/perl/lib/5.00503/sun4-solaris/Config.pm line 7.
[Fri Apr 7 03:32:04 2006] lib.pm:
[Fri Apr 7 03:32:04 2006] lib.pm: BEGIN failed--compilation aborted at /oracle/iAS/1.0.2.2/Apache/perl/lib/5.00503/lib.pm line 4. BEGIN failed--compilation aborted at /ncsa/cgi-bin/<myuserid>/R12_OO_search.pl line 14.

The line 7 at Config.pm is:

Code:
$] == 5.00503  or die "Perl lib version (5.00503) doesn't match executable version ($])";

The line 4 in lib.pm is a simple "use Config;".

The line 14 in /ncsa/cgi-bin/<myuserid>/R12_OO_search.pl is:

Code:
use lib '/home/<myuserid>/public_html/cgi-bin/UTILS/Module';
use DB_conn;

The module DB_conn.pm is something I've written newly and included in the directory for whom I've done a 'use lib'.

The script works as CGI script if

(a) I copy over DB_conn.pm over the directory of the perl script OR
(b) when I comment out the 'use lib' and 'use DB_conn'....but that would sacrifice the functionality I'm trying to achieve.

Can people please help? I've spent close to 5 hours on Google searching up and reading about "Perl lib version (5.00503) doesn't match executable version (5.00502)" error. But nothing could help me.

Thanks,
Amazator.
 
Sounds like you have two copies of perl on your system. One found by iAS, and a different on found by the command line call

try changing the shebang in you cgi script to
#!/oracle/iAS/1.0.2.2/Apache/perl/bin/perl

run
perl -v
vs
/oracle/iAS/1.0.2.2/Apache/perl/bin/perl -v

to confirm

\0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top