While it's not enabled by default in VirtualHostX, you can configure the web server yourself to serve Perl scripts using CGI.
(That's the great thing about VHX - it uses a real Ubuntu Linux virtual machine. So, you can pretty much just google for anything you want to do and you'll find tons of instructions, then you can customize the VM as much as you want without worrying about harming your Mac's system files.) Anyway...
After you've gone through the VirtualHostX Welcome Window steps, you'll need to enable the web server's cgi module.
sudo a2enmod cgid
Next, create a new website in VHX. For the "Website Name" field, enter whatever you'd like. In our example, let's put
Then, choose a "Local Path" that points to the folder on your Mac containing your Perl scripts.
To tell the web server to run your scripts when you view them in your browser, you need to add the following lines to your website's "Custom Directives" boxes in VHX.
ScriptAlias / /var/www/perl-test.vhx.cloud/
(In the future, you would replace "perl-test" with whatever you chose as your "Domain Name" and append ".vhx.cloud")
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Finally, click the "checkmark" toolbar button to save your settings and restart the web server.
If all goes well, you should be able to access your Perl scripts at the Local URL that VHX gives you.