Perl Programming/Keywords/unlink

Previous: unless Keywords Next: unpack

The unlink keyword edit

unlink deletes a LIST of files and returns the number of files successfully deleted. If it is unsuccessful, it it returns false and sets $! to the error number (errno).

Syntax edit

  unlink LIST

Example edit

my $unlinked = unlink 'a', 'b', 'c';
unlink @files;
unlink glob "*.pl";

See also edit

Previous: unless Keywords Next: unpack