1CPANPLUS::Internals::UtUislesr(3C)ontributed Perl DocumeCnPtAaNtPiLoUnS::Internals::Utils(3)
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 my $version = $cb->_perl_version( perl => $^X );
19
21 "CPANPLUS::Internals::Utils" holds a few convenience functions for
22 CPANPLUS libraries.
23
25 $cb->_mkdir( dir => '/some/dir' )
26
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
33 "_chdir" changes directory to a dir.
34
35 Returns true on success, false on failure.
36
37 $cb->_rmdir( dir => '/some/dir' );
38
39 Removes a directory completely, even if it is non-empty.
40
41 Returns true on success, false on failure.
42
43 $cb->_perl_version ( perl => 'some/perl/binary' );
44
45 "_perl_version" returns the version of a certain perl binary. It does
46 this by actually running a command.
47
48 Returns the perl version on success and false on failure.
49
50 $cb->_version_to_number( version => $version );
51
52 Returns a proper module version, or '0.0' if none was available.
53
54 $cb->_whoami
55
56 Returns the name of the subroutine you're currently in.
57
58 _get_file_contents( file => $file );
59
60 Returns the contents of a file
61
62 Moves a file or directory to the target.
63
64 Returns true on success, false on failure.
65
66 Moves a file or directory to the target.
67
68 Returns true on success, false on failure.
69
70 $cb->_mode_plus_w( file => '/path/to/file' );
71
72 Sets the +w bit for the file.
73
74 Returns true on success, false on failure.
75
76 $uri = $cb->_host_to_uri( scheme => SCHEME, host => HOST, path => PATH
77 );
78
79 Turns a CPANPLUS::Config style "host" entry into an URI string.
80
81 Returns the uri on success, and false on failure
82
83 $cb->_vcmp( VERSION, VERSION );
84
85 Normalizes the versions passed and does a '<=>' on them, returning the
86 result.
87
88 $cb->_home_dir
89
90 Returns the user's homedir, or "cwd" if it could not be found
91
92 $path = $cb->_safe_path( path => $path );
93
94 Returns a path that's safe to us on Win32. Only cleans up the path on
95 Win32 if the path exists.
96
97 ($pkg, $version, $ext) = $cb->_split_package_string( package => PACK‐
98 AGE_STRING );
99
100 Splits the name of a CPAN package string up in it's package, version
101 and extension parts.
102
103 For example, "Foo-Bar-1.2.tar.gz" would return the following parts:
104
105 Package: Foo-Bar
106 Version: 1.2
107 Extension: tar.gz
108
109
110
111perl v5.8.8 2007-03-31 CPANPLUS::Internals::Utils(3)