Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

unlink

Deletes one or more files from the filesystem.

Deletes a list of files. If called with no arguments (empty list after pushmark, or no mark at all), defaults to $_. Returns the number of files successfully deleted. Does not delete directories (use rmdir for that). Uses std::fs::remove_file.

Synopsis

unlink $file;
my $count = unlink @files;
unlink or die "Cannot unlink $_: $!";   # uses $_
unlink glob("*.bak");

See Also

rename, link, rmdir