Following the excellent advice I received over in 11134028, I have restructured the webserver for the project I have just started. The directory structure is something like this:

/home/myusername/website/prod/www <- webroot /home/myusername/website/prod/lib <- scripts /home/myusername/website/prod/template <- you can guess :) /home/myusername/website/test/data
So I have a script index.pl in the webroot which is the default when the server provides a page to a browser.
index.pl uses Site::HTML which is located at /home/myusername/website/prod/lib/Site/HTML.pm

Everything works as expected. Templates are working and scripts are called as expected. Until I turn on taint mode. Then I get this error:

Insecure dependency in require while running with -T switch at index.p +l line 8. BEGIN failed--compilation aborted at index.pl line 8.
This is the start of index.pl:
#!/usr/bin/perl -T use CGI::Carp qw(fatalsToBrowser); use FindBin qw($RealBin); use lib "$RealBin/../lib"; use Site::HTML; <-- line 8 use Site::Wayfinder; use strict; use warnings; my $html = Site::HTML->new; $html->head;
Am I right that the error I get means that Site::HTML won't work under taint mode?
Any suggestions for debugging where the problem might be in Site::HTML as the error doesn't tell me where in the module to look?

I've deliberately not shared the code of Site::HTML as I would prefer to understand how to debug this problem rather than just being given the answer of what is wrong in that module. Happy to share some of the module if necessary...


In reply to Debugging a module that's failing under taint mode by Bod

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.