1CPANPLUS::Internals::UtiPlesr(l3pPmr)ogrammers ReferencCePAGNuPiLdUeS::Internals::Utils(3pm)
2
3
4
6 CPANPLUS::Internals::Utils
7
9 my $bool = $cb->_mkdir( dir => 'blah' );
10 my $bool = $cb->_chdir( dir => 'blah' );
11 my $bool = $cb->_rmdir( dir => 'blah' );
12
13 my $bool = $cb->_move( from => '/some/file', to => '/other/file' );
14 my $bool = $cb->_move( from => '/some/dir', to => '/other/dir' );
15
16 my $cont = $cb->_get_file_contents( file => '/path/to/file' );
17
18
19 my $version = $cb->_perl_version( perl => $^X );
20
22 "CPANPLUS::Internals::Utils" holds a few convenience functions for
23 CPANPLUS libraries.
24
26 $cb->_mkdir( dir => '/some/dir' )
27 "_mkdir" creates a full path to a directory.
28
29 Returns true on success, false on failure.
30
31 $cb->_chdir( dir => '/some/dir' )
32 "_chdir" changes directory to a dir.
33
34 Returns true on success, false on failure.
35
36 $cb->_rmdir( dir => '/some/dir' );
37 Removes a directory completely, even if it is non-empty.
38
39 Returns true on success, false on failure.
40
41 $cb->_perl_version ( perl => 'some/perl/binary' );
42 "_perl_version" returns the version of a certain perl binary. It does
43 this by actually running a command.
44
45 Returns the perl version on success and false on failure.
46
47 $cb->_version_to_number( version => $version );
48 Returns a proper module version, or '0.0' if none was available.
49
50 $cb->_whoami
51 Returns the name of the subroutine you're currently in.
52
53 _get_file_contents( file => $file );
54 Returns the contents of a file
55
56 Moves a file or directory to the target.
57
58 Returns true on success, false on failure.
59
60 Moves a file or directory to the target.
61
62 Returns true on success, false on failure.
63
64 $cb->_mode_plus_w( file => '/path/to/file' );
65 Sets the +w bit for the file.
66
67 Returns true on success, false on failure.
68
69 $uri = $cb->_host_to_uri( scheme => SCHEME, host => HOST, path => PATH );
70 Turns a CPANPLUS::Config style "host" entry into an URI string.
71
72 Returns the uri on success, and false on failure
73
74 $cb->_vcmp( VERSION, VERSION );
75 Normalizes the versions passed and does a '<=>' on them, returning the
76 result.
77
78 $cb->_home_dir
79 Returns the user's homedir, or "cwd" if it could not be found
80
81 $path = $cb->_safe_path( path => $path );
82 Returns a path that's safe to us on Win32 and VMS.
83
84 Only cleans up the path on Win32 if the path exists.
85
86 On VMS, it encodes dots to _ using "VMS::Filespec::vmsify"
87
88 ($pkg, $version, $ext) = $cb->_split_package_string( package =>
89 PACKAGE_STRING );
90 Splits the name of a CPAN package string up into its package, version
91 and extension parts.
92
93 For example, "Foo-Bar-1.2.tar.gz" would return the following parts:
94
95 Package: Foo-Bar
96 Version: 1.2
97 Extension: tar.gz
98
99
100
101perl v5.10.1 2009-05-03 CPANPLUS::Internals::Utils(3pm)