Subject: | perl Makefile.PL doesn't work on AIX 7.1/perl 5.10.1 |
I ran into a nasty bug that I've been working on for the last 2 days looking for a solution. Turned out to be a bug in Makefile.PL.
I'm using DBI 1.634, IBM Informix CSDK Version 3.50.
I run: "perl Makefile.PL" and get the following error!
Testing whether your Informix test environment will work...
/opt/informix/CSDK3.50.UC6/bin/esql[997]: ./esqlcc: not found.
Failed to compile esqltest.ec to esqltest.o
Turned out the "./esqlcc" program was being found, but was not recognized as a perl script. The 1st line in this file said:
#!perl
instead of
#!/usr/bin/perl
And so when the "./esqlcc" program attempted to run, it gave the misleading error of "not found."
To get the kit to build I had to do the following hack of Makefile.PL.
my($Perl) = $^X; # Translate inscrutable to scrutable!
$Perl="/usr/bin/${Perl}";
By default, it turns out the perl special variable $^X just returns the basename. And AIX 7.1 doesn't like it!
I know this fix only works for Unix where Perl is installed in this location. I'll leave it up to you to figure a generic solution.
As I was writing this use case, I discovered another way around the problem.
/usr/bin/perl Makefile.PL
would have worked as well. Turns out in that case $^X will return the full path to perl.
Another solution is you could do the following on the 1st line:
#!/usr/bin/env perl
I've done the above in the past where I had multiple versions of Perl installed on a server and I wanted to swap between them by just updating my PATH.
Curtis