Solaris 10 comes with pre-installed perl with a fixed set of perl modules. When you want extra modules on your system, the modules need to be compiled on the system and the process isn’t simple to be honest. Googled a lot and visited various links. With all the information gathered, I managed to install the modules I needed. The process is outlined as below. So if your OS is same as mine, hopefully installation of modules will be less painful.
This is how I installed Data Dumper on Solaris 10 box under a directory /opt/perl/modules.
Environment:
host1# uname -a
SunOS host1 5.10 Generic_142900-12 sun4v sparc SUNW,Sun-Fire-T200
host1# perl -v
This is perl, v5.8.4 built for sun4-solaris-64int
(with 32 registered patches, see perl -V for more detail)
Copyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
Steps to compile the module:
1. Download the module from CPAN (http://cpan.perl.org/) on to you desktop and copy into a directory on the server from there. Gunzip, untar, and cd into the module directory.
host1# gunzip Data-Dumper-2.131.tar.gz
host1# tar xvf Data-Dumper-2.131.tar
host1# cd Data-Dumper-2.131
2. Run the following command to generate Makefile.
host1# /usr/perl5/bin/perlgcc Makefile.PL LIB=/opt/perl/modules PREFIX=/opt/perl/modules
Checking if your kit is complete…
Looks good
Writing Makefile for Data::Dumper
NOTE: If it complains about a missing module and you know it is installed, then set the perl library path, and run perlgcc again.
host1# PERL5LIB=$PERL5LIB:PATH_WHERE_MISSING_MODULE_IS_ALREADY_INSTALLED; export PERL5LIB
3. Run “make” to prepare the make file.
host1# make
cp Dumper.pm blib/lib/Data/Dumper.pm
/usr/perl5/5.8.4/bin/perl /usr/perl5/5.8.4/lib/ExtUtils/xsubpp -typemap /usr/perl5/5.8.4/lib/ExtUtils/typemap Dumper.xs > Dumper.xsc && mv Dumper.xsc Dumper.c
gcc -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TS_ERRNO -O2 -fno-strict-aliasing -DVERSION=\”2.131\” -DXS_VERSION=\”2.131\” -fPIC “-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE” -DUSE_PPPORT_H Dumper.c
Dumper.xs: In function `XS_Data__Dumper_Dumpxs’:
Running Mkbootstrap for Data::Dumper ()
chmod 644 Dumper.bs
rm -f blib/arch/auto/Data/Dumper/Dumper.so
LD_RUN_PATH=”” gcc -G Dumper.o -o blib/arch/auto/Data/Dumper/Dumper.so
chmod 755 blib/arch/auto/Data/Dumper/Dumper.so
cp Dumper.bs blib/arch/auto/Data/Dumper/Dumper.bs
chmod 644 blib/arch/auto/Data/Dumper/Dumper.bs
4. Run “make test” to check whether previous command worked correctly.
host1# make test
PERL_DL_NONLAZY=1 /usr/perl5/5.8.4/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘blib/lib’, ‘blib/arch’)” t/*.t
t/bless………ok
2/11 skipped: no ‘re::regexp_pattern’
t/bugs……….ok
1/7 skipped: perl 5.10.1 crashes and DD cannot help it
t/dumper……..ok
t/freezer…….ok
t/overload……ok
t/pair……….ok
t/perl-74170….ok
t/terse………ok
All tests successful, 3 subtests skipped.
Files=8, Tests=420, 3 wallclock secs ( 2.33 cusr + 0.22 csys = 2.55 CPU)
5. Run “make install” to install the module.
host1# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/Dumper.so
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/Dumper.bs
Installing /opt/perl/modules/sun4-solaris-64int/auto/Data/Dumper/Dumper.bs
Installing /opt/perl/modules/sun4-solaris-64int/Data/Dumper.pm
Appending installation info to /opt/perl/modules/sun4-solaris-64int/perllocal.pod
host1#
6. Run /usr/perl5/5.8.4/bin/instmodsh to verify the modules installed.
host1# instmodsh
Available commands are:
l – List all installed modules
m – Select a module
q – Quit the program
cmd? l
Installed modules are:
Data::Dumper
ExtUtils::Install
ExtUtils::MakeMaker
Parse::RecDescent
Perl
Test::Simple
cmd? q
host1#
Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /home/customer/www/sanspire.com/public_html/wp-content/themes/swatch/includes/theme-comments.php:63 Stack trace: #0 /home/customer/www/sanspire.com/public_html/wp-content/themes/swatch/includes/theme-comments.php(19): the_commenter_link() #1 /home/customer/www/sanspire.com/public_html/wp-includes/class-walker-comment.php(183): custom_comment(Object(WP_Comment), Array, 1) #2 /home/customer/www/sanspire.com/public_html/wp-includes/class-wp-walker.php(147): Walker_Comment->start_el('', Object(WP_Comment), 1, Array) #3 /home/customer/www/sanspire.com/public_html/wp-includes/class-walker-comment.php(139): Walker->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #4 /home/customer/www/sanspire.com/public_html/wp-includes/class-wp-walker.php(390): Walker_Comment->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #5 /home/customer/www/sanspire.com/public_html/wp-includes/comment-template.php(2391): Walker->paged_walk(Array, '5', 0, 0 in /home/customer/www/sanspire.com/public_html/wp-content/themes/swatch/includes/theme-comments.php on line 63