App-p5stack
view release on metacpan or search on metacpan
lib/App/p5stack.pm view on Meta::CPAN
print "[p5stack $now] $msg\n";
}
sub _do_help {
print "Usage:\n",
" \$ p5stack setup # setup env in current directory\n",
" \$ p5stack perl <program> [args] # run a program\n",
" \$ p5stack bin <file> [args] # execute a locally installed bin file\n",
" \$ p5stack run <command> [args] # setup env and run an arbitrary command\n",
" \$ p5stack cpanm [args] # execute local env cpanm\n";
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
App::p5stack - manage your dependencies and perl requirements locally
=head1 VERSION
version 0.004
=head1 SYNOPSIS
B<Warning>: this tool is still under development and badly tested, use
with care!
Manage your dependencies and perl requirements locally, by projects (directory).
# set up configuration in your application directory
$ cat > p5stack.yml
---
perl: 5.20.3
deps: dzil
# setup the environment
$ p5stack setup
# run your application
$ p5stack perl <application>
# execute an installed program for this environment
$ p5stack bin <program>
=head1 DESCRIPTION
p5stack is a tool that given a small set of configuration directives allows to
quickly (in a single command) setup the required modules inside a local directory
specific to this project. Including a specific perl version if required. This
allows to constrain all the required elements to run your application to live
inside the application directory. And thus not clashing to system wide perl
installations.
Configuration files are written in YAML, an example configuration looks
like:
---
perl: 5.20.3
deps: dzil
This tells p5stack that you want to use perl version 5.20.3, and to use
dzil to find the required modules for the application. By default all
perl versions are installed inside $HOME/.p5stack, and all the required
modules are install in a .local directory. This way you can share perl
releases installations, but have a local directory with the required
modules for each project.
After setting up the environment with the required perl and modules
using the I<setup> command:
$ p5stack setup
You can run a command using the environment using:
$ p5stack perl <program>
Or execute a program installed by a module using:
$ p5stack bin <program>
You system perl and other possible installations remain unchanged.
The local installation of modules is done using
L<App-cpanminus|http://search.cpan.org/dist/App-cpanminus/>
and L<local-lib|http://search.cpan.org/dist/local-lib/>.
=head1 EXAMPLES OF USE
=head2 Simple Example
Imagine a very simple project:
$ ls -A
dist.ini ex1
which contains a script:
$ cat ex1
#!/usr/bin/perl
use Acme::123;
Acme::123->new->printnumbers;
that requires the Acme::123 module, as described in this simple dzil file:
$ cat dist.ini
name = ex1
[Prereqs]
Acme::123 = 0
To setup the environment to run this using p5stack just run the tool with
the setup command:
( run in 0.564 second using v1.01-cache-2.11-cpan-39bf76dae61 )