My nifty blog search feature is temporarily b0rken. This is because:
- My web hosts run Slackware on their Linux machines
- I don't have any access to the Apache configuration, etc., so I can't do things like set environment variables for CGI scripts or configure the error logging to give me adaquate information
I mention setting environment variables because I'm using a shared library
of my own devising, which resides in my home directory, and I therefore have
to tell the Perl code which loads it where to find it. The way to do this,
I thought, was to set the LD_LIBRARY_PATH environment variable
to point to the right place. The obvious hack to get things up and
running quickly was to put this in the Perl:
# Yuck. use lib '/home/qef/usr/lib/site_perl'; use lib '/home/qef/blog'; # Double yuck. $ENV{LD_LIBRARY_PATH} = '/home/qef/usr/lib';
This doesn't work. Having talked to Aaron (from work) about this last
time I grappled with it, we came up with the theory that the
dynamic linker, or Perl, or something, only looks at LD_LIBRARY_PATH
when it starts up, and by the time it starts executing Perl code, it's
too late.
This leads to an even more crufty solution. It worked last time, sort of.
I need to set the environment up before the perl process starts,
and I can't do that in the Apache config (with SetEnv) because
I'm not allowed at it. But I can set up the environment in one CGI script
and use it as a wrapper to run the one I wanted. Might as well do this
in shell:
#!/bin/sh # Triple yuck. export LD_LIBRARY_PATH=/home/qef/usr/lib echo | /home/qef/blog/WWW/search/search.pl
The echo needs to be in there because the CGI::Lite module
which the script uses will try to read POST data from the standard input.
I know there won't be any, because the form uses GET.
Well that was fine last time, but it seems to have broken. It took me hours to get it up and running last time, and I haven't got the energy right now to fiddle about with it again. Instead I'm relaxing with a very spicy Bloody Mary and a stick of celery.