Search code examples
perlcygwinenvironment-variablesstrawberry-perl

How can I modify my cygwin environment to use Strawberry Perl instead of the packaged Perl distribution?


I currently use Strawberry Perl as my primary Perl distribution. However, I have some applications that make Perl calls through cygwin. These generally fail because they are calling the version of Perl that was packaged with cygwin, and only looking in cygwin's lib folders. How can I modify my cygwin environment to call Strawberry Perl (and use the C:/strawberry/perl/lib dirs) instead?


Solution

  • If you remove Perl from cygwin using the setup program it will use Strawberry Perl by default.

    If you are unable to remove Perl from cygwin, you can create a symbolic link to the Perl executable from Strawberry.

    From a cygwin shell, use the following set of commands:

    $ mv /usr/bin/perl /usr/bin/perl-cygwin
    $ ln -s /cygdrive/c/strawberry/perl/bin/perl.exe /usr/bin/perl
    

    This is assuming you used the default Strawberry Perl installer. Update your perl.exe location accordingly if you have it installed somewhere else.

    Check to make sure the link is working properly by checking the Perl version:

    $ perl -v
    

    It should say This is perl, (version) built for MSWin32-x86-multi-thread (or similar) and not built for cygwin-thread-multi-64int.