1PerlReq::Utils(3) User Contributed Perl Documentation PerlReq::Utils(3)
2
3
4
6 PerlReq::Utils - auxiliary routines for B::PerlReq, perl.req and
7 perl.prov
8
10 This module provides the following convenience functions:
11
12 path2mod
13 Convert file path to module name, e.g. File/Find.pm -> File::Find.
14
15 mod2path
16 Convert module name to file path, e.g. File::Find -> File/Find.pm.
17
18 path2dep
19 Convert file path to conventional dependency name, e.g.
20 File/Find.pm -> perl(File/Find.pm). Note that this differs from
21 RedHat conventional form perl(File::Find).
22
23 mod2dep
24 Convert module name to conventional dependency name, e.g.
25 File::Find -> perl(File/Find.pm). Note that this differs from
26 RedHat conventional form perl(File::Find).
27
28 verf
29 Format module version number, e.g. 2.12 -> 2.120. Currently
30 truncated to 3 digits after decimal point, except for all zeroes,
31 e.g. 2.000 -> 2.0.
32
33 Update. The algorithm has been amended in almost compatible way so
34 that versions do not lose precision when truncated. Now we allow
35 one more .ddd series at the end, but .000 is still truncated by
36 default, e.g. 2.123 -> 2.123, 2.123456 -> 2.123.456.
37
38 verf_perl
39 Format Perl version number, e.g. 5.005_03 -> 1:5.5.30.
40
41 sv_version
42 Extract version number from B::SV object. v-strings converted to
43 floats according to Perl rules, e.g. 1.2.3 -> 1.002003.
44
45 argv
46 Obtain a list of files passed on the command line. When command
47 line is empty, obtain a list of files from standard input, one file
48 per line. Die when file list is empty. Check that each file
49 exists, or die otherwise. Canonicalize each filename with
50 "File::Spec::rel2abs()" function (which makes no checks against the
51 filesystem).
52
53 inc Obtain a list of Perl library paths from @INC variable, except for
54 current directory. The RPM_PERL_LIB_PATH environment variable, if
55 set, is treated as a list of paths, seprarated by colons; put these
56 paths in front of the list. Canonicalize each path in the list.
57
58 Finally, the RPM_BUILD_ROOT environment variable, if set, is
59 treated as installation root directory; each element of the list is
60 then prefixed with canonicalized RPM_BUILD_ROOT path and new values
61 are put in front of the list.
62
63 After all, only existent directories are returned.
64
65 explode
66 Split given filename into its prefix (which is a valid Perl library
67 path, according to the inc() function above) and basename. Return
68 empty list if filename does not match any prefix.
69
71 Written by Alexey Tourbin <at@altlinux.org>.
72
74 Copyright (c) 2004 Alexey Tourbin, ALT Linux Team.
75
76 This is free software; you can redistribute it and/or modify it under
77 the terms of the GNU Library General Public License as published by the
78 Free Software Foundation; either version 2 of the License, or (at your
79 option) any later version.
80
82 B::PerlReq, perl.req, perl.prov
83
84
85
86perl v5.12.0 2009-09-27 PerlReq::Utils(3)