Perl: Difference between revisions
Created page with "== Perl == Perl is one of the most established programming languages on the Internet. With its powerful string processing capabilities and the optional availability of almost every library imaginable, Perl is an excellent choice for somebody looking to allow flexibility and expandability. At HelioHost, we offer Perl configured with more than 100 basic libraries and can add additional modules upon request. If you're a Perl developer looking for free hosting, HelioHost is..." |
m Update to use H2 headers for better readability |
||
(4 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
== Details == | == Details == | ||
If you need a different version of Perl, you'll need to get a [https://heliohost.org/vps/ VPS]. | {{Info|If you need a different version of Perl, you'll need to get a [https://heliohost.org/vps/ VPS]. You can get a 10% discount when you pay for 6 months upfront.}} | ||
{| class="wikitable" style="margin:auto" | {| class=="wikitable" style=="margin:auto" | ||
|- | |- | ||
! Server !! Path !! Version !! Loader | ! Server !! Path !! Version !! Loader | ||
Line 24: | Line 24: | ||
== Requesting additional Perl libraries == | == Requesting additional Perl libraries == | ||
To request additional libraries, please raise a request in the [ | To request additional libraries, please raise a request in the [https://helionet.org/index/forum/45-customer-service/?do==add Customer Service forum], making sure to provide your '''username''', your '''server''', and '''the libraries you need''' including any relevant '''version numbers''' for them. | ||
== Disabled == | == Disabled == | ||
Line 38: | Line 38: | ||
== Navigate to your main domain == | == Navigate to your main domain == | ||
If you were transferred from the old cPanel, your main domain will be parked on the | If you were transferred from the old cPanel, your main domain will be parked on the 'public_html' directory. | ||
If you created a new account on Plesk, your directory will be | If you created a new account on Plesk, your directory will be 'httpdocs'. | ||
== Create a | == Create a 'perl.pl' file inside the 'cgi-bin' directory with these contents: == | ||
<pre> | <pre> | ||
Line 53: | Line 53: | ||
== Edit file permissions == | == Edit file permissions == | ||
Edit the | Edit the 'perl.pl' file's CHMOD permissions to '755' ('rwx r-x r-x'). | ||
== Open file in your browser == | == Open file in your browser == | ||
Navigate to | Navigate to 'domain.heliohost.us/cgi-bin/perl.pl' in your browser. | ||
If everything is working you should see | If everything is working you should see 'Perl as CGI is working...' displayed in your browser. | ||
== Guidance for editing | == Guidance for editing 'perl.pl' == | ||
Leave the first line as the shebang ( | Leave the first line as the shebang ('#!/usr/bin/perl'). | ||
Below the shebang, you may write Perl code. | Below the shebang, you may write Perl code. | ||
Ensure you output a | Ensure you output a 'Content-type' header before anything else. | ||
== Making Perl executable inside | == Making Perl executable inside 'httpdocs' == | ||
If you prefer to make Perl executable directly inside the | If you prefer to make Perl executable directly inside the 'httpdocs' folder, you can do this by using an '.htaccess' file with these contents: | ||
<pre> | <pre> | ||
Line 78: | Line 78: | ||
</pre> | </pre> | ||
You can then navigate to | You can then navigate to 'domain.heliohost.us/perl.pl' and view the 'Perl as CGI is working...' success message. | ||
== Further Learning == | == Further Learning == | ||
A good tutorial can be found [https://perlmaven.com/installing-perl-and-getting-started here]. | A good tutorial can be found [https://perlmaven.com/installing-perl-and-getting-started here]. |
Latest revision as of 17:10, 17 January 2025
Perl
Perl is one of the most established programming languages on the Internet. With its powerful string processing capabilities and the optional availability of almost every library imaginable, Perl is an excellent choice for somebody looking to allow flexibility and expandability. At HelioHost, we offer Perl configured with more than 100 basic libraries and can add additional modules upon request. If you're a Perl developer looking for free hosting, HelioHost is the place to be.
Details
If you need a different version of Perl, you'll need to get a VPS. You can get a 10% discount when you pay for 6 months upfront.
Server | Path | Version | Loader |
---|---|---|---|
Johnny | /usr/bin/perl | 5.16.3 | CGI |
Tommy | /usr/bin/perl | 5.16.3 | CGI |
Enabled
Extensive set of default libraries
HelioHost offers more than 100 Perl libraries by default on all free hosting accounts.
Requesting additional Perl libraries
To request additional libraries, please raise a request in the Customer Service forum, making sure to provide your username, your server, and the libraries you need including any relevant version numbers for them.
Disabled
Root-level Access
As a security restriction, we force each Perl script to run as its HelioHost user through suEXEC. This prevents any actions that require root-level access. This shouldn't be a problem for legitimate uses.
Getting Started
Perl scripts are easy to configure and run. To test it out with a simple example, follow the steps below:
If you were transferred from the old cPanel, your main domain will be parked on the 'public_html' directory.
If you created a new account on Plesk, your directory will be 'httpdocs'.
Create a 'perl.pl' file inside the 'cgi-bin' directory with these contents:
#!/usr/bin/perl print "Content-type: text/html\r\n\r\n"; print "Perl as CGI is working...";
Edit file permissions
Edit the 'perl.pl' file's CHMOD permissions to '755' ('rwx r-x r-x').
Open file in your browser
Navigate to 'domain.heliohost.us/cgi-bin/perl.pl' in your browser.
If everything is working you should see 'Perl as CGI is working...' displayed in your browser.
Guidance for editing 'perl.pl'
Leave the first line as the shebang ('#!/usr/bin/perl').
Below the shebang, you may write Perl code.
Ensure you output a 'Content-type' header before anything else.
Making Perl executable inside 'httpdocs'
If you prefer to make Perl executable directly inside the 'httpdocs' folder, you can do this by using an '.htaccess' file with these contents:
Options +ExecCGI AddHandler cgi-script .pl
You can then navigate to 'domain.heliohost.us/perl.pl' and view the 'Perl as CGI is working...' success message.
Further Learning
A good tutorial can be found here.