File::Remove - Remove files and directories
use File::Remove qw(remove); remove \1,"file1","file2","directory1","file3","directory2","file4", "directory2","file5","directory3"; # removes only files, even if the filespec matches a directory remove "*.c","*.pl"; # recurses into subdirectories and removes them all remove \1, "directory";
File::Remove::remove removes files and directories. It acts like 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.
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.
Just calls remove. It's there for people who get tired of typing 'remove'.
See SYNOPSIS.
Not that I know of. ;)
Gabor Egressy gabor@vmunix.com
Copyright (c) 1998 Gabor Egressy. 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.
To install File::Remove, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::Remove
CPAN shell
perl -MCPAN -e shell install File::Remove
For more information on module installation, please visit the detailed CPAN module installation guide.