Bloody Slackware, Bloody Mary

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.

< MySQL boredom | 3D fractals with OpenGL, in Perl >

Miniblog

(nuggets of inanity)

Tuesday Apr 24th 2007, 16:54 »
Just took the annual web design survey that AListApart do. I don't realy consider myself to be a web designer, but I have been doing a lot of HTML and CSS lately.
Monday Apr 23rd 2007, 18:23 »
Strange, there appears to be a bare-knuckle boxing match going on in the field outside my flat. Wish they wouldn't make so much noise about it.
Thursday Mar 1st 2007, 18:47 »
“In its written form, Hebrew has no vowels, making it the ideal language for texting.”
—Said in jest on some Radio 4 programme just now.

Archive: 2007 · 2006 · 2005 · 2004
Feed