|Uniform Server 5.0-Nano. PHP 5.2.10|
Uniform Server 5.1-Nano. PHP 5.3.0
Uniform Server 5.0-Nano and Perl
Although for server control Uniform Server no longer uses Perl it remains fully supported.
Perl is a very powerful scripting language to do it justice two plugins are provided full and mini Perl.
Full-Perl as the name implies consists of the core program and all modules while mini-Perl consists of the core program and a collection of commonly used Perl modules.
ActivePerl is multi platform, runs on Windows, Linux, Mac OS X, Solaris, AIX and HP-UX.
Apart from being robust and reliable one of its main features is portability.
There are two plugins to choose from either full or mini.
- ActivePerl 188.8.131.525
- ActivePerl 184.108.40.2066
The mini plugin is suitable for majority of smaller applications. Larger and more advanced application download the full plugin.
Downloaded the plugins from from Sourceforge choose one of the following:
|V5.0_mini_perl.exe||5.07 MB||16.5 MB||Contains Perl core program with a collection of commonly used Perl modules.|
|V5.0_mini_perl.zip||7.13 MB||16.5 MB||Contains Perl core program with a collection of commonly used Perl modules.|
|V5.0_full_perl.exe||10.6 MB||52.2 MB||Contains Perl core program and full set of Perl modules.|
|V5.0_full_perl.zip||16.0 MB||52.2 MB||Contains Perl core program and full set of Perl modules.|
|V5.1_mini_perl.exe||5.14 MB||16.9 MB||Contains Perl core program with a collection of commonly used Perl modules.|
|V5.1_mini_perl.zip||7.21 MB||16.9 MB||Contains Perl core program with a collection of commonly used Perl modules.|
|V5.1_full_perl.exe||10.9 MB||54.1 MB||Contains Perl core program and full set of Perl modules.|
|V5.1_full_perl.zip||16.5 MB||54.1 MB||Contains Perl core program and full set of Perl modules.|
Non-Perl users I hope will appreciate what a significant overhead it is even with mini-Perl installed hence the reason for making Perl a plugin.
If space is at a premium Perl users can start with mini-Perl and add modules as required from full-Perl.
Note: Don't mix modules from different versions.
By far the easiest way to install Perl is to download one of the executables and install as follows:
- Copy file V5.#_mini_perl.exe or V5.#_full_perl.exe to folder UniServer
- Double click on file to run the self-extracting archive
- For Perl to be picked up restart the servers.
Creates two new folders bin and lib in folder UniServer\usr These contain the Perl program and Perl modules respectively.
Installing from a zip file requires a few extra steps as follows:
- Copy file V5.#_mini_perl.zip or V5.#_full_perl.zip to any folder.
- Extract to current path.
- Copy folders bin and lib to folder UniServer\usr
- For Perl to be picked up restart the servers.
These contain the Perl program and Perl modules respectively.
UniServer automatically detects the presence of Perl and enables functionality to support it in both Apanel and UniTray.
Perl scripts are placed in folder UniServer\cgi-bin and any sub-folders as appropriate.
Each script requires a shebang this must be an absolute path to the Perl executable for example:
Moving UniServer to another location automatically updates this shebang.
Server control on detecting a server move writes a new shebang to all files with a .pl or .cgi extension.
An automatic update is initiated only when the servers are moved.
After extracting a third party Perl script to cgi-bin you must either move the servers or force a shebang update using UniTray. Alternatively you can manually edit each file.
With Perl installed a new menu option become available in Apanel. This displays the Perl environment and additional information.
Force shebang update
Perl scripts contain a Shebang (first line) this informs a server where to find the Perl program. Uniform Server is dynamic and tracks any path changes automatically updating the Shebang.
However if the server remains static and you have added new scripts in the cgi-bin folder the Shebang is never updated. Hence run the following menu item after installing new scripts. It updates the Shebang in all files to the current Perl location.
left click tray icon > Advance > click "Perl Shebang Update cgi-bin"
When writing Perl scripts you can use the following for the shebang:
From UniTray run "Perl Shebang Update cgi-bin" and all pages will be updated with the correct shebang.
Convert to Unix format
Perl scripts developed on Windows will not run on a Unix machine they require conversion to Unix format.
Run the conversion script from UniTray as follows:
left click tray icon > Advance > click "Perl win2unix + Shebang Update"
This script copies all files in cgi-bin to a new folder \cgi-bin-unix\
Scripts in this new folder are converted from Windows to Unix format.
- Converts end of line: Dec(#10#13=>#13) Hex 0D0A to 0A
- Replaces Windows shebang with Unix shebang
Related Topic Links
Perl CGI Hello World - Short snippets to get you started with Perl
Uniform Server has been pre-configured for Perl hence after installing either of the plugins Perl is ready to run scripts.
For convenience any Uniform Server plugin requiring Perl support such as AWStats come complete with mini-Perl and any additional modules required to support that plugin.
Next page covers UniTray