Carton
view release on metacpan or search on metacpan
lib/Carton.pm view on Meta::CPAN
package Carton;
use strict;
use 5.008_005;
use version; our $VERSION = version->declare("v1.0.35");
1;
__END__
=head1 NAME
Carton - Perl module dependency manager (aka Bundler for Perl)
=head1 SYNOPSIS
# On your development environment
> cat cpanfile
requires 'Plack', '0.9980';
requires 'Starman', '0.2000';
> carton install
> git add cpanfile cpanfile.snapshot
> git commit -m "add Plack and Starman"
# Other developer's machine, or on a deployment box
> carton install
> carton exec starman -p 8080 myapp.psgi
# carton exec is optional
> perl -Ilocal/lib/perl5 local/bin/starman -p 8080 myapp.psgi
> PERL5LIB=/path/to/local/lib/perl5 /path/to/local/bin/starman -p 8080 myapp.psgi
=head1 AVAILABILITY
Carton only works with perl installation with the complete set of core
modules. If you use perl installed by a vendor package with modules
stripped from core, Carton is not expected to work correctly.
Also, Carton requires you to run your command/application with
C<carton exec> command or to include the I<local/lib/perl5> directory
in your Perl library search path (using C<PERL5LIB>, C<-I>, or
L<lib>).
=head1 DESCRIPTION
carton is a command line tool to track the Perl module dependencies
for your Perl application. Dependencies are declared using L<cpanfile>
format, and the managed dependencies are tracked in a
I<cpanfile.snapshot> file, which is meant to be version controlled,
and the snapshot file allows other developers of your application will
have the exact same versions of the modules.
For C<cpanfile> syntax, see L<cpanfile> documentation.
=head1 TUTORIAL
=head2 Initializing the environment
carton will use the I<local> directory to install modules into. You're
recommended to exclude these directories from the version control
system.
> echo local/ >> .gitignore
> git add cpanfile cpanfile.snapshot
> git commit -m "Start using carton"
=head2 Tracking the dependencies
You can manage the dependencies of your application via C<cpanfile>.
# cpanfile
requires 'Plack', '0.9980';
requires 'Starman', '0.2000';
And then you can install these dependencies via:
> carton install
The modules are installed into your I<local> directory, and the
dependencies tree and version information are analyzed and saved into
I<cpanfile.snapshot> in your directory.
Make sure you add I<cpanfile> and I<cpanfile.snapshot> to your version
controlled repository and commit changes as you update
dependencies. This will ensure that other developers on your app, as
well as your deployment environment, use exactly the same versions of
the modules you just installed.
> git add cpanfile cpanfile.snapshot
> git commit -m "Added Plack and Starman"
( run in 1.127 second using v1.01-cache-2.11-cpan-e93a5daba3e )