Strawberry Perl

From Win32 Perl Wiki

Jump to: navigation, search

Contents

[edit] Description

Get it at http://strawberryperl.com/

Strawberry Perl is part of the Vanilla Perl Project to provide binary distributions of Perl for the Windows operating system. It includes a bundled compiler and pre-installed modules that offer the ability to install XS CPAN modules directly from CPAN. It also comes with a number of bundled distributions that are both important and hard to install.

The purpose of the Strawberry Perl series is to provide a practical Win32 Perl environment for experienced Perl developers to experiment with and test the installation of various CPAN modules under Win32 conditions, and to provide a useful platform for doing real work.

Strawberry Perl includes:

  • Perl 5.10.0 or 5.8.9
  • Mingw GCC C/C++ compiler
  • Dmake "make" tool
  • ExtUtils::CBuilder and ExtUtils::ParseXS
  • Bundle::CPAN (including Perl modules that largely eliminate the need for external helper programs like gzip and tar)
  • Bundle::LWP (providing more reliable http CPAN repository support)
  • XML::Parser and XML::LibXML, enabling most CPAN XML modules
  • DBI and DBD drivers for SQLite, ODBC, MySQL and Postgres
  • Additional minor modules to enhance the stability of Win32

[edit] Install

The latest Strawberry Perl releases are available from http://strawberryperl.com/ .

Log in as an administrator and launch the installer .msi file With this you will have:

  • Strawberry Perl in C:\strawberry
  • C:\strawberry\c\bin;C:\strawberry\perl\bin added to the system path

Check if it works in the (cmd.exe) console:

perl -v

This gives something like

This is perl, v5.10.0 built for MSWin32-x86-multi-thread

Copyright 1987-2007, 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.

If you have another version of Perl installed on your computer, verify you are using the proper one with

C:\strawberry\perl\bin\perl -v

If there is another version of Perl in your Path:

  • From the desktop, right-click My Computer and click properties
  • In the System Properties window, click on the Advanced tab
  • In the Advanced section, click the Environment Variables button
  • In the Environment Variables window, highlight the path variable in the Systems Variable section and click edit. Remove the paths to elder versions of Perl


Feedback is appreciated at the Strawberry Perl Feedback page.

[edit] FAQ

[edit] Where do I get support?

Community support is available on the #win32 IRC channel at irc.perl.org, or see the Strawberry Perl support page at http://strawberryperl.com/support.html

[edit] Troubleshooting

Symptom: running a script with I/O redirection produces "Can't dup STDOUT: Permission denied" (or "Can't dup STDERR"). Solution: instead of running `foo.pl > foo.txt`, run `perl foo.pl > foo.txt`.

[edit] What platforms are supported

Most modern Windows operating systems are supported. Strawberry has been tested with, and officially supports.

  • Windows XP
  • Windows Server 2003 32-bit
  • Windows Server 2003 64-bit
  • Windows Vista
  • Windows Server 2008 32-bit
  • Windows Server 2008 64-bit
  • Windows 7

[edit] What should I do if installing a module from CPAN fails?

There are several things you should do:

  • Review the error log and try to determine the cause of the failure.
  • If it's a dependency error, quit cpan and restart it. Try the installation again. Sometimes, dependencies are too complicated to resolve in one pass.
  • If it still didn't work, you should report the error.
  • If the problem appears to be a failure of the module itself, either compiling or running its tests, report that to the module author at rt.cpan.org. If the failure was only in the tests, you can force the installation if you want with "force install X" (where X is the module in question).

[edit] How do I get it to compile XS modules on Vista?

The standard installation has some problems on Vista due to the new UAC system. Cosimo Streppone found that adding "c:\strawberry-perl\mingw\libexec\gcc\mingw32\3.4.5" to your PATH environment variable fixes compilation errors.

Sisyphus found that, alternatively, installing Service Pack 1 fixes the problems.

[edit] Gotcha with PPM in portable version

This is a bug at least in Strawberry perl portable Beta 2, involving .../perl/site/lib/PPM.pm in InstallPackage(). Long story short, these lines:

384         $tarzip->extract($tarzip->list_files);
385         $basename =~ /(.*).tar/i;
386     }
387     chdir($1);
388     RelocPerl('.') if ($Config{'osname'} ne 'MSWin32');
389
390   InstallBlib:

can sometimes result in $1 being empty, which will chdir() to $ENV{HOME} and cause the install to silently fail. If $ENV{HOME} is unset, chdir does nothing and the installation succeeds (which probably means chdir shouldn't be called at all). So unset $ENV{HOME}, chdir to .../perl/bin to be safe, and run .\ppm.bat and your installation should succeed. Logged as RT 44584.

 # in portable strawberry perl, change to the ..\perl\bin dir
 P:\> cd dev\aliasperl-b3\perl\bin
 
 # trigger the bug in ppm
 P:\dev\aliasperl-b3\perl\bin> set HOME=c:\
 # it downloads and silently exits
 P:\dev\aliasperl-b3\perl\bin> .\ppm
 PPM interactive shell (0.01_01) - type 'help' for available commands.
 PPM> install List::MoreUtils
 Install package 'List-MoreUtils?' (y/N): y
 Installing package 'List-MoreUtils'...
 Bytes transferred: 28541
 PPM> quit
 Quit!
 
 # it didn't install it
 > .\perl -MList::MoreUtils -e print
 Can't locate List/MoreUtils.pm in @INC (@INC contains:
 P:/dev/aliasperl-b3/perl/lib
 P:/dev/aliasperl-b3/perl/site/lib .).
 BEGIN failed--compilation aborted.
 # remove and try again, this time clearing HOME
 > .\ppm
 PPM interactive shell (0.01_01) - type 'help' for available commands.
 PPM> remove List::MoreUtils
 Remove package 'List-MoreUtils?' (y/N): y
 PPM> quit
 Quit!
 
 > set HOME=
 > set HOME
 HOMEDRIVE=N:
 HOMEPATH=\
 HOMESHARE=\\sjcnetapp\home\ksethura
 # install works this time
 > .\ppm
 PPM interactive shell (0.01_01) - type 'help' for available commands.
 PPM> install List::MoreUtils
 Install package 'List-MoreUtils?' (y/N): y
 Installing package 'List-MoreUtils'...
 Bytes transferred: 28541
 Files found in blib\arch: installing files in blib\lib into architecture depende
 nt library tree
 Installing P:\dev\aliasperl-b3\perl\site\lib\auto\List\MoreUtils\MoreUtils.bs
 Installing P:\dev\aliasperl-b3\perl\site\lib\auto\List\MoreUtils\MoreUtils.dll
 Installing P:\dev\aliasperl-b3\perl\site\lib\auto\List\MoreUtils\MoreUtils.exp
 Installing P:\dev\aliasperl-b3\perl\site\lib\auto\List\MoreUtils\MoreUtils.lib
 Installing P:\dev\aliasperl-b3\perl\site\lib\List\MoreUtils.pm
 PPM> quit
 Quit!
 
 # now no error
 > .\perl -MList::MoreUtils -e  print
 
 >

[edit] cpan doesn't set compiler path in portable version

Attempting to install an XS-based module from cpan produces:

 P:\dev\aliasperl-b3\perl\bin> .\cpan
 cpan shell -- CPAN exploration and modules installation (v1.94)
 ReadLine support enabled
 
 cpan> install Win32::Process
 Database was generated on Thu, 09 Jul 2009 02:34:52 GMT
 Running install for module 'Win32::Process'
 Running make for J/JD/JDB/Win32-Process-0.14.tar.gz
 ...
 gcc -c          -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT
   blah blah blah "-IP:\dev\aliasperl-b3\perl\lib\CORE"   Process.cpp
 'gcc' is not recognized as an internal or external command, 
 operable program or batch file.
 dmake.exe:  Error code 129, while making 'Process.o'
   JDB/Win32-Process-0.14.tar.gz
   P:\dev\aliasperl-b3\c\bin\dmake.exe -- NOT OK

It looks like PATH isn't set to find the included compilers and hence cpan installs fail. Explicitly setting the PATH variable as follows:

 P:\dev\aliasperl-b3\perl\bin> set PATH=%PATH%;p:\dev\aliasperl-b3\c\bin
 P:\dev\aliasperl-b3\perl\bin> set PATH=%PATH%;p:\dev\aliasperl-b3\c\mingw32\bin

and then installing via cpan succeeds:

 P:\dev\aliasperl-b3\perl\bin> .\cpan
 
 cpan shell -- CPAN exploration and modules installation (v1.94)
 ReadLine support enabled
 
 cpan> install Win32::Process
 Database was generated on Thu, 09 Jul 2009 02:34:52 GMT
 Running install for module 'Win32::Process'
 Running make for J/JD/JDB/Win32-Process-0.14.tar.gz
 ...
 P:\dev\aliasperl-b3\c\bin\dmake.exe -- OK
 
 Running make test
 P:\dev\aliasperl-b3\perl\bin\perl.exe "-Iblib\lib" "-Iblib\arch" test.pl
 ...
 P:\dev\aliasperl-b3\c\bin\dmake.exe test -- OK
 
 Running make install
 ...
 P:\dev\aliasperl-b3\c\bin\dmake.exe install UNINST=1 -- OK
 
 cpan>

[edit] Highly Visible Issues

  • Digest-SHA (64bit compile warnings)
  • Digest-SHA (newline issues) (mostly fixed now)
  • CPAN (upgrades that replace cpan.bat require a reboot)
  • CPAN (ctrl-c doesn't clear lock files right)
  • Term-ReadKey (a number of special key issues)

See also Vanilla Perl Problem Modules.

[edit] Copyright and License

Strawberry Perl is open source. Please see the Vanilla Perl Project page for license details.

Personal tools