Debian Codegraph @

upstream/mageia-cauldron/man3pm/File::DosGlob.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "File::DosGlob 3pm"
61 .TH File::DosGlob 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 File::DosGlob \- DOS like globbing and then some
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& require 5.004;
72 \&
73 \& # override CORE::glob in current package
74 \& use File::DosGlob \*(Aqglob\*(Aq;
75 \&
76 \& # override CORE::glob in ALL packages (use with extreme caution!)
77 \& use File::DosGlob \*(AqGLOBAL_glob\*(Aq;
78 \&
79 \& @perlfiles = glob "..\e\epe?l/*.p?";
80 \& print <..\e\epe?l/*.p?>;
81 \&
82 \& # from the command line (overrides only in main::)
83 \& > perl \-MFile::DosGlob=glob \-e "print <../pe*/*p?>"
84 .Ve
85 .SH DESCRIPTION
86 .IX Header "DESCRIPTION"
87 A module that implements DOS\-like globbing with a few enhancements.
88 It is largely compatible with perlglob.exe (the M$ setargv.obj
89 version) in all but one respect\-\-it understands wildcards in
90 directory components.
91 .PP
92 For example, \f(CW\*(C`<..\e\el*b\e\efile/*glob.p?>\*(C'\fR will work as expected (in
93 that it will find something like \*(Aq..\elib\eFile/DosGlob.pm\*(Aq alright).
94 Note that all path components are case\-insensitive, and that
95 backslashes and forward slashes are both accepted, and preserved.
96 You may have to double the backslashes if you are putting them in
97 literally, due to double\-quotish parsing of the pattern by perl.
98 .PP
99 Spaces in the argument delimit distinct patterns, so
100 \&\f(CW\*(C`glob(\*(Aq*.exe *.dll\*(Aq)\*(C'\fR globs all filenames that end in \f(CW\*(C`.exe\*(C'\fR
101 or \f(CW\*(C`.dll\*(C'\fR. If you want to put in literal spaces in the glob
102 pattern, you can escape them with either double quotes, or backslashes.
103 e.g. \f(CW\*(C`glob(\*(Aqc:/"Program Files"/*/*.dll\*(Aq)\*(C'\fR, or
104 \&\f(CW\*(C`glob(\*(Aqc:/Program\e Files/*/*.dll\*(Aq)\*(C'\fR. The argument is tokenized using
105 \&\f(CWText::ParseWords::parse_line()\fR, so see Text::ParseWords for details
106 of the quoting rules used.
107 .PP
108 Extending it to csh patterns is left as an exercise to the reader.
109 .SH "EXPORTS (by request only)"
110 .IX Header "EXPORTS (by request only)"
111 \&\fBglob()\fR
112 .SH BUGS
113 .IX Header "BUGS"
114 Should probably be built into the core, and needs to stop
115 pandering to DOS habits. Needs a dose of optimization too.
116 .SH AUTHOR
117 .IX Header "AUTHOR"
118 Gurusamy Sarathy <[email protected]>
119 .SH HISTORY
120 .IX Header "HISTORY"
121 .IP \(bu 4
122 Support for globally overriding \fBglob()\fR (GSAR 3\-JUN\-98)
123 .IP \(bu 4
124 Scalar context, independent iterator context fixes (GSAR 15\-SEP\-97)
125 .IP \(bu 4
126 A few dir\-vs\-file optimizations result in glob importation being
127 10 times faster than using perlglob.exe, and using perlglob.bat is
128 only twice as slow as perlglob.exe (GSAR 28\-MAY\-97)
129 .IP \(bu 4
130 Several cleanups prompted by lack of compatible perlglob.exe
131 under Borland (GSAR 27\-MAY\-97)
132 .IP \(bu 4
133 Initial version (GSAR 20\-FEB\-97)
134 .SH "SEE ALSO"
135 .IX Header "SEE ALSO"
136 perl
137 .PP
138 perlglob.bat
139 .PP
140 Text::ParseWords