Since you're familiar with perlbrew, you could still use that to install Perl.
perlbrew install 5.16.1 --as=5.16.1t -Dusethreads
You just make sure you give proper permissions. Say your $PERLBREW_ROOT
is /home/djh/perl5/perlbrew
(the default):
chmod a+x /home/djh/
chmod a+x /home/djh/perl5/
chmod a+x /home/djh/perl5/perlbrew/
chmod a+x /home/djh/perl5/perlbrew/perls/
chmod -R a+rX /home/djh/perl5/perlbrew/perls/5.16.1t/ # Capital "X"!!!
Then use the following shebang line in your script:
#!/home/djh/perl5/perlbrew/perls/5.16.1t/bin/perl
But maybe you don't want it in your home. If so, this is what you can do:
cd /tmp
wget http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/perl-5.16.1.tar.bz2
tar xvjf perl-5.16.1.tar.bz2
cd perl-5.16.1
sh Configure -des -Dprefix=/opt/perls/5.16.1t -Dusethreads
make test
sudo mkdir /opt/perls/5.16.1t
sudo chown djh:djh /opt/perls/5.16.1t
make install
The installer will setup the permissions correctly. All you have to do is set the shebang to
#!/opt/perls/5.16.1t/bin/perl
("t" is my convention for threaded builds. Remove -Dusethreads
if you don't want thread support.)