The perlbrew for Windows Strawberry Perl!
berrybrew can download, install, remove and manage multiple concurrent
versions of Strawberry Perl for Windows. There is no
to have Strawberry Perl installed before using
Updating the list of Strawberry Perls available is as simple as runing a single
berrybrew fetch, and works at runtime.
Table of Contents
- Update Perls Available
- Configure Perl Instance Directory
- Compile Your Own
- Create a Release
git clone https://github.com/stevieb9/berrybrew
Pre-built zip archive
You can also Compile your own installation.
See Configure Root Directory if you wish to change the default location that your Perl installations will reside.
cd berrybrew bin\berrybrew.exe config
berrybrew <command> [subcommand] [option] available List available Strawberry Perl versions and which are installed config Add berrybrew to your PATH clean * Remove all temporary berrybrew files clone Clones an installed version to a custom-named one fetch Upgrade the list of Strawberry Perl instances available install Download, extract and install a Strawberry Perl register Manually register a custom installation directory remove Uninstall a Strawberry Perl switch Switch to use a different Strawberry Perl off Disable berrybrew perls (use 'switch' to re-enable) exec * Run a command for every installed Strawberry Perl unconfig Remove berrybrew from PATH upgrade Backs up config, does a `git pull`, and restores config use * Use a specific Strawberry Perl version temporarily help Display this help screen license Show berrybrew license version Displays the version * - view subcommand details with 'berrybrew <command> help'
List all available versions of Perl that are available:
> berrybrew available The following Strawberry Perls are available: 5.26.0_64 5.26.0_64_PDL 5.26.0_32 5.24.2_64 5.24.2_64_PDL 5.24.2_32 5.22.3_64 5.22.3_64_PDL 5.22.3_32 5.20.3_64 5.20.3_64_PDL 5.20.3_32 5.18.4_64 5.18.4_32 5.16.3_64 5.16.3_32 5.14.4_64 5.14.4_32 5.12.3_32 5.10.1_32 [installed] 5.8.9_32 5.24.1_64 [custom] [installed] * * Currently using
Install a specific version:
> berrybrew install 5.26.0_64
Switch to a different version (permanently):
> berrybrew switch 5.26.0_64 Switched to 5.26.0_64, start a new terminal to use it.
Start a new cmd.exe to use the new version:
> perl -v This is perl 5, version 26, subversion 0 (v5.26.0) built for MSWin32-x64-multi-thread ...
Clone an installed instance (very useful for setting up a main instance, and cloning it into an instance named "template")
> berrybrew clone 5.26.0_64 template
Uninstall a version of perl:
> berrybrew remove 5.26.0_64 Successfully removed Strawberry Perl 5.26.0_64
Manually register a custom directory within the Perl installation directory
> berrybrew register my_custom_install
Disable berrybrew entirely, and return to system Perl (Strawberry or ActiveState), if available (re-enable with 'switch'):
> berrybrew off
Temporarily use a selected version:
> berrybrew use 5.10.1_32
Temporarily use a Perl version, but spawn in a new command window:
> berrybrew use --win 5.10.1_32
Temporarily spawn several versions, all in new windows:
> berrybrew use --win 5.10.1_32,5.24.2_64,5.26.0_64
Execute something across all perls (we do not execute on Perls that has 'tmpl' or 'template' in the name):
> berrybrew exec prove -l Perl-5.26.0_64 ============== t\DidYouMean.t .. ok All tests successful. Files=1, Tests=5, 0 wallclock secs ( 0.06 usr + 0.00 sys = 0.06 CPU) Result: PASS Perl-5.22.3_32 ============== t\DidYouMean.t .. ok All tests successful. Files=1, Tests=5, 0 wallclock secs ( 0.03 usr + 0.03 sys = 0.06 CPU) Result: PASS Perl-5.18.4_64 ============== t\DidYouMean.t .. Dubious, test returned 5 (wstat 1280, 0x500) Failed 5/5 subtests Test Summary Report ------------------- t\DidYouMean.t (Wstat: 1280 Tests: 5 Failed: 5) Failed tests: 1-5 Non-zero exit status: 5 Files=1, Tests=5, 0 wallclock secs ( 0.02 usr + 0.05 sys = 0.06 CPU) Result: FAIL
Execute on only a selection of installed versions:
> berrybrew exec --with 5.26.0_64,5.10.1_32 perl "die()" Perl-5.26.0_64 ============== Died at -e line 1. Perl-5.10.1_32 ============== Died at -e line 1.
> berrybrew upgrade
PATH (useful for switching between versions of
> berrybrew unconfig
Easiest way is to use
berrybrew upgrade. This requires Git to be
installed and in your
PATH. It will create a
directory and copy your configuration files into it.
After completion, it'll copy your
perls_custom.json file back into the
directory. The rest of the configuration JSON files will be replaced. If you had
any customizations within any of the other configuration files, you'll need to
manually merge those changes back into the updated config file in
Doing a straight
git pull will overwrite your configuration files, so
back them up first (see Caveats).
Update Perls Available
berrybrew fetch to retrieve the most recent availability list from
Strawberry Perl. If any new or changed versions are found, we'll update the
perls.json file with them.
Configure Root Directory
By default, we manage Perls out of the
C:\berrybrew directory. To
change this, modify the
root_dir value in the
Use double-backslashes (
\\) as the path separators.
WARNING: At this time, it is highly advised not to change this after
you've already installed any instances of Perl. This feature is
PATH and other things don't get properly reset yet.
If you choose to ignore this, follow this procedure:
berrybrew off, to flush the
edit the configuration file to reflect the new directory
move all Perl installations from the old path to the new one
remove the old directory
berrybrew switch $versionto set things back up
Compile Your Own
git clone https://github.com/stevieb9/berrybrew cd berrybrew # compile the API library mcs \ -lib:bin \ -t:library \ -r:Newtonsoft.Json.dll,ICSharpCode.SharpZipLib.dll \ -out:bin/bbapi.dll \ src/berrybrew.cs # compile the berrybrew.exe binary mcs \ src/bbconsole.cs -lib:bin -r:bbapi.dll \ -out:bin/berrybrew.exe \ -win32icon:inc/berrybrew.ico bin\berrybrew.exe config
Create a Release
If you've modified the information of the configuration files for the new
build, you must copy them to the
dev\data directory before performing the
Use the included
dev/release.pl script, which:
berrybrew.exebinary and the
collects default configuration files
builds the bundled zip archive, and puts it into
performs SHA1 checksum tasks
README.mdfile with the zip archive's new SHA1 sum
If you had any custom configuration files in place, run
dev\post_release.pl to restore them.
.Net Framework 2.0 or higher
Mono or Visual Studio (only if compiling your own version)
If you run into trouble installing a Perl, try clearing the berrybrew
cached downloads by running
You can also enable debugging to get more verbose output on the command line:
berrybrew debug <command> [options]
berrybrew Full documentation for the application
Berrybrew API API documentation
Unit Testing Documentation for unit testing
Configuration Guide to various configuration files and options
git pullto do an upgrade, your configuration files will be overwritten with the defaults. If you have any customizations, make a backup of the
datadirectory before upgrade, then copy the files back to their original location. Note that you may have to manually add any new config directives into the original config files. The
perls_custom.jsonfile used for custom Perl installations (clones) will never be overwritten, and this warning does not apply for it.
At this time,
berrybrewrequires Administrative privileges to operate correctly. This is due to the way Windows forces the System
PATHto take precedence over User
2 Clause FreeBSD - see LICENSE
David Farrell [http://perltricks.com]
This Fork Maintained By
Updating dnmfarrell berrybrew
git clone https://email@example.com/dnmfarrell/berrybrew bb-dnm cd bb-dnm git remote add stevieb9 https://github.com/stevieb9/berrybrew git pull stevieb9 master git push