Citrus Perl and Raspberry Pi

Citrus Perl on Raspberry

| 0 Comments

Note:

My current and future development is concentrating on a stand alone distribution of Perl modules, Perl and Raspberry Pi, for installation in the system Perl on Raspberry Pi.




As you might expect Perl is provided as part of the standard Raspbian Wheezy images. However, I always like to work with a separate installation of Perl. It means that I don't interfere or conflict with the system processes that rely on the system Perl and I can configure my Perl according to my own requirements.

I have supported a binary Perl distribution called Citrus Perl for some time. It provides wxPerl GUI tools along with pre-built modules to connect to common Open Source databases and is available for Windows, Linux on x86 / x86_64 and Mac OS X. 

I have produced a binary version of Citrus Perl for Raspbian Wheezy to provide a similar environment for the Raspberry Pi and have released it for download and installation.

Before downloading and installing Citrus Perl you need to install a few prerequisites. The standard Raspbian images use the gcc compiler version 4.6.3 by default. Perl compilation fails for ARM processors as used in the Raspberry Pi using this compiler. The later release gcc 4.7 is required. We can install gcc 4.7 on the Raspberry Pi. It can co-exist happily with the standard gcc 4.6.3.

If you have not updated your package system recently, you should do so first.

sudo apt-get update

You can then install compiler tools that will allow Citrus Perl to build modules as required from the CPAN.

sudo apt-get install make gcc-4.7 g++-4.7

The final prerequisites are the database client libraries if you intend to use DBD::Pg or DBD::mysql -

sudo apt-get install libmysqlclient18 libpq5

Citrus Perl installs from a tarball to a fixed location under /var/local. The installation path is /var/local/citrus so the tarball is simply the 'citrus' directory. You should download and extract Citrus Perl using 'sudo'.

cd /var/local

sudo wget http://sourceforge.net/projects/
                 citrusperl/files/Raspberry%20Pi/
                 citrus-raspbian-20130201.tar.bz2

sudo tar xjf citrus-raspbian-20130201.tar.bz2

Installation is then complete. To use Citrus Perl you can run a script referencing the executable directly -

/var/local/citrus/bin/perl myscript.pl

Or you can put the necessary directories on your path within a session so that the Citrus Perl executable becomes the default for that session - 

export PATH=/var/local/citrus/site/bin:
            /var/local/citrus/bin:$PATH

perl myscript.pl

You can also make your scripts executable and use the first script line to identify the required command -

#!/var/local/citrus/bin/perl -w

For users of wxPerl you can run the WX::Demo application using :

/var/local/citrus/site/bin/wxperl_demo.pl

or if you have exported the amended $PATH as above you can simply

wxperl_demo.pl

For information, if you wish to build Perl from source rather than use a binary distribution, my configure script is here.

Leave a comment

About this Entry

This page contains a single entry by Mark Dootson published on February 2, 2013 3:01 AM.

Setting Up My Pi was the previous entry in this blog.

Enabling I2C, SPI and 1 Wire is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.