1File::Remove(3)       User Contributed Perl Documentation      File::Remove(3)
2
3
4

NAME

6       File::Remove - Remove files and directories
7

VERSION

9       version 1.58
10

SYNOPSIS

12           use File::Remove 'remove';
13
14           # removes (without recursion) several files
15           remove( '*.c', '*.pl' );
16
17           # removes (with recursion) several directories
18           remove( \1, qw{directory1 directory2} );
19
20           # removes (with recursion) several files and directories
21           remove( \1, qw{file1 file2 directory1 *~} );
22
23           # removes without globbing:
24           remove( \1, {glob => 0}, '*');
25
26           # trashes (with support for undeleting later) several files
27           trash( '*~' );
28

DESCRIPTION

30       File::Remove::remove removes files and directories.  It acts like
31       /bin/rm, for the most part.  Although "unlink" can be given a list of
32       files, it will not remove directories; this module remedies that.  It
33       also accepts wildcards, * and ?, as arguments for filenames.
34
35       File::Remove::trash accepts the same arguments as remove, with the
36       addition of an optional, infrequently used "other platforms" hashref.
37

VERSION

39       version 1.58
40

SUBROUTINES

42   remove
43       Removes files and directories.  Directories are removed recursively
44       like in rm -rf if the first argument is a reference to a scalar that
45       evaluates to true.  If the first argument is a reference to a scalar,
46       then it is used as the value of the recursive flag.  By default it's
47       false so only pass \1 to it.
48
49       If the next argument is a hash reference then it is a key/values of
50       options.  Currently, there is one supported option of "'glob' => 0"
51       which prevents globbing. E.g:
52
53           remove(\1, {glob => 0}, '*');
54
55       Will not remove files globbed by '*' and will only remove the file
56       called asterisk if it exists.
57
58       In list context it returns a list of files/directories removed, in
59       scalar context it returns the number of files/directories removed.  The
60       list/number should match what was passed in if everything went well.
61
62   rm
63       Just calls remove.  It's there for people who get tired of typing
64       remove.
65
66   clear
67       The "clear" function is a version of "remove" designed for use in test
68       scripts. It takes a list of paths that it will both initially delete
69       during the current test run, and then further flag for deletion at END-
70       time as a convenience for the next test run.
71
72   trash
73       Removes files and directories, with support for undeleting later.
74       Accepts an optional "other platforms" hashref, passing the remaining
75       arguments to remove.
76
77       Win32
78           Requires Win32::FileOp.
79
80           Installation not actually enforced on Win32 yet, since
81           Win32::FileOp has badly failing dependencies at time of writing.
82
83       OS X
84           Requires Mac::Glue.
85
86       Other platforms
87           The first argument to trash() must be a hashref with two keys,
88           'rmdir' and 'unlink', each referencing a coderef.  The coderefs
89           will be called with the filenames that are to be deleted.
90
91   expand
92       DO NOT USE. Kept for legacy.
93
94   undelete
95       DO NOT USE. Kept for legacy.
96

SUPPORT

98       Bugs should always be submitted via the CPAN bug tracker
99
100       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove>
101
102       For other issues, contact the maintainer.
103

AUTHOR

105       Adam Kennedy <adamk@cpan.org>
106
108       Taken over by Shlomi Fish (<http://www.shlomifish.org/>) while
109       disclaiming all rights and placing his modifications under
110       CC0/public-domain/MIT/any-other-licence.
111
112       Some parts copyright 2006 - 2012 Adam Kennedy.
113
114       Taken over by Adam Kennedy <adamk@cpan.org> to fix the "deep readonly
115       files" bug, and do some package cleaning.
116
117       Some parts copyright 2004 - 2005 Richard Soderberg.
118
119       Taken over by Richard Soderberg <perl@crystalflame.net> to port it to
120       File::Spec and add tests.
121
122       Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>.
123
124       This program is free software; you can redistribute and/or modify it
125       under the same terms as Perl itself.
126

AUTHOR

128       Shlomi Fish <shlomif@cpan.org>
129
131       This software is copyright (c) 1998 by Gabor Egressy.
132
133       This is free software; you can redistribute it and/or modify it under
134       the same terms as the Perl 5 programming language system itself.
135

BUGS

137       Please report any bugs or feature requests on the bugtracker website
138       <http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Remove> or by email to
139       bug-file-remove@rt.cpan.org <mailto:bug-file-remove@rt.cpan.org>.
140
141       When submitting a bug or request, please include a test-file or a patch
142       to an existing test-file that illustrates the bug or desired feature.
143

SUPPORT

145   Perldoc
146       You can find documentation for this module with the perldoc command.
147
148         perldoc File::Remove
149
150   Websites
151       The following websites have more information about this module, and may
152       be of help to you. As always, in addition to those websites please use
153       your favorite search engine to discover more resources.
154
155       ·   MetaCPAN
156
157           A modern, open-source CPAN search engine, useful to view POD in
158           HTML format.
159
160           <https://metacpan.org/release/File-Remove>
161
162       ·   Search CPAN
163
164           The default CPAN search engine, useful to view POD in HTML format.
165
166           <http://search.cpan.org/dist/File-Remove>
167
168       ·   RT: CPAN's Bug Tracker
169
170           The RT ( Request Tracker ) website is the default bug/issue
171           tracking system for CPAN.
172
173           <https://rt.cpan.org/Public/Dist/Display.html?Name=File-Remove>
174
175       ·   AnnoCPAN
176
177           The AnnoCPAN is a website that allows community annotations of Perl
178           module documentation.
179
180           <http://annocpan.org/dist/File-Remove>
181
182       ·   CPAN Ratings
183
184           The CPAN Ratings is a website that allows community ratings and
185           reviews of Perl modules.
186
187           <http://cpanratings.perl.org/d/File-Remove>
188
189       ·   CPANTS
190
191           The CPANTS is a website that analyzes the Kwalitee ( code metrics )
192           of a distribution.
193
194           <http://cpants.cpanauthors.org/dist/File-Remove>
195
196       ·   CPAN Testers
197
198           The CPAN Testers is a network of smoke testers who run automated
199           tests on uploaded CPAN distributions.
200
201           <http://www.cpantesters.org/distro/F/File-Remove>
202
203       ·   CPAN Testers Matrix
204
205           The CPAN Testers Matrix is a website that provides a visual
206           overview of the test results for a distribution on various
207           Perls/platforms.
208
209           <http://matrix.cpantesters.org/?dist=File-Remove>
210
211       ·   CPAN Testers Dependencies
212
213           The CPAN Testers Dependencies is a website that shows a chart of
214           the test results of all dependencies for a distribution.
215
216           <http://deps.cpantesters.org/?module=File::Remove>
217
218   Bugs / Feature Requests
219       Please report any bugs or feature requests by email to "bug-file-remove
220       at rt.cpan.org", or through the web interface at
221       <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Remove>. You
222       will be automatically notified of any progress on the request by the
223       system.
224
225   Source Code
226       The code is open to the world, and available for you to hack on. Please
227       feel free to browse it and play with it, or whatever. If you want to
228       contribute patches, please send me a diff or prod me to pull from your
229       repository :)
230
231       <https://github.com/shlomif/File-Remove>
232
233         git clone git://github.com/shlomif/File-Remove.git
234
235
236
237perl v5.32.0                      2020-07-28                   File::Remove(3)
Impressum