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.


In reply to Re^3: Do XS-components require special considerations with CGI? by almut
in thread Do XS-components require special considerations with CGI? [SOLVED] by locked_user sundialsvc4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.