in reply to Re: Do XS-components require special considerations with CGI?
in thread Do XS-components require special considerations with CGI? [SOLVED]

Well, apparently not ... my “mental flash” apparently did not help.

Looking at perldoc DynaLoader, I observe (in the discussion of the bootstrap subroutine, which is described as “the normal entry point for automatic dynamic loading in Perl”), that it “locates an auto/$module directory by searching @INC” ... So I know that I am missing something that will soon cause me to slap my forehead vigorously.

But right now, I have “hit a mine” and I am dead-in-the-water with the clock ticking fast.

Replies are listed 'Best First'.
Re^3: Do XS-components require special considerations with CGI?
by almut (Canon) on Feb 26, 2009 at 15:13 UTC

    Maybe it's easier to debug this by just taking a look at what is actually going on under the hood — e.g. using strace.  Just create a wrapper something like this

    #!/bin/sh strace -o /tmp/strace.out -efile /path/to/your-cgi-script.pl

    (The -efile is optional, and filters the output to only log file-related system calls, such as open, stat, access,...  In case your script involves subprocesses, you might want to use option -f, in order to trace forked processes, too.)

    Then compare non-working vs. working, i.e. the output you get when running it via the webserver against the output you get when you call it on the command line.

    This should give you a rather precise idea of which paths are being searched, what files are being opened, or aren't found, etc.  Maybe it's worth mentioning upfront that it's perfectly normal to get lots of "ENOENT (No such file or directory)" — this just shows what's being tried, not necessarily that there's a problem. It only indicates a problem if some file which needs to be loaded, is producing nothing but ENOENTs, or some other error. You get the idea...  In case you're having difficulties interpreting the details, just post the output here.

      I didn't listen. Either time.

      “To those who come after,” carefully re-read the post that this is in-reply to.