1CPANPLUS::Internals::ExUtsrearctC(o3n)tributed Perl DocuCmPeAnNtPaLtUiSo:n:Internals::Extract(3)
2
3
4
6 CPANPLUS::Internals::Extract
7
9 ### for source files ###
10 $self->_gunzip( file => 'foo.gz', output => 'blah.txt' );
11
12 ### for modules/packages ###
13 $dir = $self->_extract( module => $modobj,
14 extractdir => '/some/where' );
15
17 CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS.
18 It can do this by either a pure perl solution (preferred) with the use
19 of "Archive::Tar" and "Compress::Zlib", or with binaries, like "gzip"
20 and "tar".
21
22 The flow looks like this:
23
24 $cb->_extract
25 Delegate to Archive::Extract
26
28 $dir = _extract( module => $modobj, [perl => '/path/to/perl', extract‐
29 dir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL,
30 force => BOOL] )
31
32 "_extract" will take a module object and extract it to "extractdir" if
33 provided, or the default location which is obtained from your config.
34
35 The file name is obtained by looking at "$modobj->status->fetch" and
36 will be parsed to see if it's a tar or zip archive.
37
38 If it's a zip archive, "__unzip" will be called, otherwise "__untar"
39 will be called. In the unlikely event the file is of neither format, an
40 error will be thrown.
41
42 "_extract" takes the following options:
43
44 module
45 A "CPANPLUS::Module" object. This is required.
46
47 extractdir
48 The directory to extract the archive to. By default this looks
49 something like:
50 /CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME
51
52 prefer_bin
53 A flag indicating whether you prefer a pure perl solution, ie "Ar‐
54 chive::Tar" or "Archive::Zip" respectively, or a binary solution
55 like "unzip" and "tar".
56
57 perl
58 The path to the perl executable to use for any perl calls. Also
59 used to determine the build version directory for extraction.
60
61 verbose
62 Specifies whether to be verbose or not. Defaults to your corre‐
63 sponding config entry.
64
65 force
66 Specifies whether to force the extraction or not. Defaults to your
67 corresponding config entry.
68
69 All other options are passed on verbatim to "__unzip" or "__untar".
70
71 Returns the directory the file was extracted to on success and false on
72 failure.
73
74
75
76perl v5.8.8 2007-03-31 CPANPLUS::Internals::Extract(3)