Table of Content

msys by default with perl 5.6, I would like to replace it as latest perl version, I have few options:

  • compile perl from source using mingw gcc
  • install msys extention 5.8 pre-compiled
  • portable strawberry perl 5.18

I am lazy so prefer last one, in fact that is most easy way to get latest perl to go !

1) remove perl 5.6 from msys

instead of really remove perl 5.6 from msys, I just rename them from /bin

perl.exe_removed
perl5.6.1.exe_removed
perlbug_removed
perlcc_removed
perldoc_removed
perlld_removed
pl2pm_removed
pod2html_removed
pod2latex_removed
pod2man_removed
pod2text_removed
pod2usage_removed
podchecker_removed
podselect_removed

2) add new strawberry perl path in msys /etc/profile

# strawberry perl 5.18 
export PATH=$PATH:/portable/portable-perl5.18/perl/site/bin:/portable/portable-perl5.18/perl/bin:/portable/portable-perl5.18/c/bin

3) verify perl 5.18 setup

$ which perl
/portable/portable-perl5.18/perl/bin/perl

$ perl -v

This is perl 5, version 18, subversion 4 (v5.18.4) built for MSWin32-x86-multi-thread-64int

Copyright 1987-2013, 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.org/, the Perl Home Page.

4) test perl script

better to use #!env perl instead of #!/usr/bin/perl, it will find perl from env path

$ less hello.pl
#!env perl 
print "Hello World!\n"