PERL cPanelUserConfig.pm usage on localhost

Beaumont

Registered
Jul 2, 2020
3
0
1
Toronto, Canada
cPanel Access Level
Reseller Owner
Hi, I've been working at setting up a local development server to give my older sites a refresh. They're coded in PERL CGI.

I've got everything working from the DEV environment, but the script reference to "use cPanelUserConfig.pm" isn't something I'm sure how to navigate.

It was a while ago that my host (HostDime) stopped supporting many direct-installed perl modules, and instead made them available only via cPanel. I suppose I could install the modules I was using directly (the old-fashioned way!) but that would mean I would need to change the script headers *every time* I push or pull my code to the live server.

Are there any workarounds or best practices that I'm not aware of?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
I've got everything working from the DEV environment, but the script reference to "use cPanelUserConfig.pm" isn't something I'm sure how to navigate.
Can you clarify this? Where are you seeing this? The Perl Module is /usr/local/share/perl5/cPanelUserConfig.pm
 

Beaumont

Registered
Jul 2, 2020
3
0
1
Toronto, Canada
cPanel Access Level
Reseller Owner
On the hosted server (run by HostDime) that is indeed where the module is. So, the 'use' line works just fine when the scripts are in the production environment.

The trouble I'm having is that the module is only available while the scripts are hosted on that server, and not on my local computer that I'm using as a development environment. I don't have cPanel on my local dev environment. (at least, currently.)

So, I'm wondering if there Is a way to mimic the module, or install a copy of it from the production environment into a dev environment that doesn't have cPanal installed on it? Or, is there maybe a way to require the module in the script with a full referenced URL so it grabs the production module regardless of what physical computer it's on?
 

Beaumont

Registered
Jul 2, 2020
3
0
1
Toronto, Canada
cPanel Access Level
Reseller Owner
For the sake of the forum, I've landed on workaround that seems obvious and logical after it's been done. I installed the perl Modules that were being loaded by cPanelUserConfig.pm directly onto my development machine, and then made the loading of cPanelUserConfig.pm dependent on a perl environment variable (IP) so it only triggers when on the virtual host. Cheers!