PERL Info

From TheBestLinux.com
Jump to navigation Jump to search

Perl Module Information

Perl is one of my favorite scripting languages and has a lot of available modules with which to assist & expand it's functionality!

CPAN Install Information

This is just an example:

perl -MCPAN -e 'install HTML::Template' 



CPAN Module Installation from Source Code

Sometimes, due to the required/desired Perl module is not easily available via the standard command line "MCPAN..." command, or you want to force a specific version or tweak the module's way it works, allowing for total customization, it's preferable to manually install a Perl module from source code after downloading and compiling. Here are the basic to do it yourself. I will use the same Perl module, HTML::Template, referenced in the previous example above.

The first thing to do is download the actual source code files required to compile, also referred to "building" the source code into an executable binary most people are accustomed to running. But before downloading the "tarball", which is the Linux/UNIX equivalent to a .Zip archive, it's best practice to first create a directory/folder on the computer's hard drive to store the "tarball" file archive which contains all of the files required to "build", aka "compile", the files into the required binary which is the format the computer needs in order to "run" the application, whatever that may be.

All of these examples are intended to be run from a command line, so from the Linux X-Windows GUI, so be sure to perform all of these steps within a "Terminal", assuming you have booted into and logged into the Linux graphical environment, X-Windows. If you unfortunately have to remotely log into the Linux machine from a M$ Windoze box, you can still easily do so using PuTTY. Please check out my PuTTY & SuperPuTTY wiki page for more info! :P~


These detailed steps assume you are using a standard Red Hat Linux based distribution(Distro) running the default Gnome desktop environment. If you are running some other desktop environment such as KDE, XFCE, etc, please adjust these instructions accordingly.

First, open up a Terminal window. On the Gnome desktop environment, move your mouse to the far upper left corner of the monitor screen, and then "normal left-click" on "Activities" in the far upper left corner of the screen. That will pull up the "Favorites" bar on the far left side of the screen, with a button at the very bottom left to "Show Applications". Click on this button, and then scroll down to the very bottom/last screen of icons and click on the "Utilities" icon, which will open up a sub-menu window, which among others will have the "Terminal"icon. Click on the Terminal icon to start up a new Terminal window. You will then have a command line window, similar to a Windows/DOS Command(cmd) window, but having a little different format for the command prompt, such as seen here on my laptop:

[jamie@dell-1640 ~]$  



Here's a screenshot of the actual terminal window on one of my laptops running Fedora 27:

Terminal Screenshot-001.jpg