in reply to removing files

Functions unlink (for files), rmdir (for empty directories) and rmtree (for directories which may not be empty) might be of interest. rmtree is in File::Path, a core module.