=head1 NAME Perl::LibExtractor - determine perl library subsets for building distributions =head1 SYNOPSIS use Perl::LibExtractor; =head1 DESCRIPTION The purpose of this module is to determine subsets of your perl library, that is, a set of files needed to satisfy certain dependencies (e.g. of a program). The goal is to extract a part of your perl installation including dependencies. A typical use case for this module would be to find out which files are needed to be build a L distribution, to link into an L binary, or to pack with L, to create stand-alone distributions tailormade to run your app. =head1 METHODS To use this module, first call the C-constructor and then as many other methods as you want, to generate a set of files. Then query the set of files and do whatever you want with them. The command-line utility F can be a convenient alternative to using this module directly, and offers a few extra options, such as to copy out the files into a new directory, strip them and/or manipulate them in other ways. =cut package Perl::LibExtractor; our $VERSION = '1.1'; use Config; use Cwd (); use File::Spec (); use File::Temp (); use common::sense; sub I_SRC () { 0 } sub I_DEP () { 1 } sub croak($) { require Carp; Carp::croak "(Perl::LibExtractor) $_[0]"; } my $canonpath = File::Spec->can ("canonpath"); my $case_tolerant = File::Spec->case_tolerant; sub canonpath($) { local $_ = $canonpath->(File::Spec::, $_[0]); s%\\%/%g; # $_ = lc if $case_tolerant; # we assume perl file name case is always the same $_ } =head2 CREATION =over 4 =item $extractor = new Perl::LibExtractor [key => value...] Creates a new extractor object. Each extractor object stores some configuration options and a subset of files that can be queried at any time,. Binary executables (such as the perl interpreter) are stored inside F, perl scripts are stored under F