NAME

File::Remove - Remove files and directories

SYNOPSIS

use File::Remove qw(remove);

# removes (without recursion) several files
remove qw( *.c *.pl );

# removes (with recursion) several directories
remove \1, qw( directory1 directory2 ); 

# removes (with recursion) several files and directories
remove \1, qw( file1 file2 directory1 *~ );

# removes (with support for undeleting later) several files
undelete qw( *~ );

DESCRIPTION

File::Remove::remove removes files and directories. It acts like /bin/rm, for the most part. Although unlink can be given a list of files, it will not remove directories; this module remedies that. It also accepts wildcards, * and ?, as arguments for filenames.

File::Remove::undelete accepts the same arguments as remove.

METHODS

remove

Removes files and directories. Directories are removed recursively like in rm -rf if the first argument is a reference to a scalar that evaluates to true. If the first arguemnt is a reference to a scalar then it is used as the value of the recursive flag. By default it's false so only pass \1 to it.

In list context it returns a list of files/directories removed, in scalar context it returns the number of files/directories removed. The list/number should match what was passed in if everything went well.

rm

Just calls remove. It's there for people who get tired of typing 'remove'.

undelete

Removes files and directories, with support for undeleting later. Arguments are passed unmodified to remove.

Win32

Requires Win32::FileOp.

OS X

Requires Mac::Glue.

Other platforms

Not supported at this time.

BUGS

See http://rt.cpan.org/NoAuth/Bugs.html?Dist=File-Remove for the up-to-date bug listing.

AUTHOR

Taken over by Richard Soderberg, <perl@crystalflame.net>, so as to port it to File::Spec and add tests.

Original copyright: (c) 1998 by Gabor Egressy, <gabor@vmunix.com>.

All rights reserved. All wrongs reversed. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself.