SteveW Posted December 6, 2010 Posted December 6, 2010 I've developed and tested on a server at home a Perl script that I'd like to use on my (shared hosting) website, but it requires a module that isn't installed on the TCH server. Is it permissible to upload the module to my own cgi-bin and use it from there? If so, is this the correct way to do it? It's working for me at home, but I'm not sure it's the best way: In the file that uses the module, instead of: >use HTML::Scrubber; I'm trying this: >do '/full/path/to/cgi-bin/Scrubber.pm'; Quote
SteveW Posted December 6, 2010 Author Posted December 6, 2010 (edited) This also appears to be a possibility : >use lib '/full/path/to/cgi-bin/'; use Scrubber; It's working (at least in tests at home), and looks like it might be preferable because it allows using "USE". Edited December 6, 2010 by SteveW Quote
TCH-Bruce Posted December 6, 2010 Posted December 6, 2010 There is an option to install Perl modules in cPanel. Quote
TCH-Alex Posted December 6, 2010 Posted December 6, 2010 If you have any issues to install the perl module through cPanel, just post a ticket to the help desk. Quote
SteveW Posted December 7, 2010 Author Posted December 7, 2010 Thanks, Bruce. I would have discovered that many weeks from now and had a "doh" moment. Before trying cPanel, I went ahead and uploaded Scrubber.pm to cgi-bin and used the 2 lines I posted previously: >use lib '/home/USER/public_html/cgi-bin/'; use Scrubber; # rather than HTML::Scrubber because it's not in an /HTML/ subdirectory. Plus, added this code to cgi-bin/.htaccess to prevent web access to any Perl modules in cgi-bin: ><FilesMatch ".+\.pm$"> order allow,deny deny from all </FilesMatch> It's working! Then I tried installing the module via cPanel, but did encounter some issues. So Alex, unless those are issues that the staff would really want to know about (that is, it would benefit the whole server), or unless there are important reasons why I shouldn't do this by the method I worked out, I'd prefer to stay with what I've got and not bother the support desk. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.