in reply to Re: Problem running cgi script (Exec format error)
in thread Problem running cgi script (Exec format error)

Hi This is the the output of @INC from the browser /usr/local/lib/perl5/5.8.6/i686-linux /usr/local/lib/perl5/5.8.6 /usr/local/lib/perl5/site_perl/5.8.6/i686-linux /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl from the command line /home/nagesh/progs/lib/perl5//i686-linux /home/nagesh/progs/lib/perl5/ /usr/local/lib/perl5/5.8.6/i686-linux /usr/local/lib/perl5/5.8.6 /usr/local/lib/perl5/site_perl/5.8.6/i686-linux /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl The first two line from the command line out put are missing from the browser output How do I make the change? Thanks
  • Comment on Re^2: Problem running cgi script (Exec format error)

Replies are listed 'Best First'.
Re^3: Problem running cgi script (Exec format error)
by Anonymous Monk on Jul 29, 2005 at 03:47 UTC
    Well, maybe GD is installed in your home directory. In that case, I guess the simplest way would be to add the following at the beginning of your script (though still underneath the #! line):
    BEGIN { unshift @INC, '/home/nagesh/progs/lib/perl5/i686-linux', '/home/nagesh/progs/lib/perl5/'; }
    Putting it in a BEGIN is important because otherwise it won't have any affect when you say use GD a few lines later. See perlmod for all the details. But, this makes it especially important that the files in your home directory are readable by Perl, which is not running under your user but rather as the Apache account.
      Hi There, Thanks a lot for the help. The code finally works!!!! It was a great relief for me to see it working. Thanks for bearing with me. Cheers Nagesh